Commit 60f8a8d4 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: fix large stack use
  fuse: cleanup in fuse_notify_inval_...()
parents b037bba7 b2d82ee3
...@@ -865,13 +865,10 @@ static int fuse_notify_inval_inode(struct fuse_conn *fc, unsigned int size, ...@@ -865,13 +865,10 @@ static int fuse_notify_inval_inode(struct fuse_conn *fc, unsigned int size,
down_read(&fc->killsb); down_read(&fc->killsb);
err = -ENOENT; err = -ENOENT;
if (!fc->sb) if (fc->sb) {
goto err_unlock;
err = fuse_reverse_inval_inode(fc->sb, outarg.ino, err = fuse_reverse_inval_inode(fc->sb, outarg.ino,
outarg.off, outarg.len); outarg.off, outarg.len);
}
err_unlock:
up_read(&fc->killsb); up_read(&fc->killsb);
return err; return err;
...@@ -884,10 +881,15 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size, ...@@ -884,10 +881,15 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
struct fuse_copy_state *cs) struct fuse_copy_state *cs)
{ {
struct fuse_notify_inval_entry_out outarg; struct fuse_notify_inval_entry_out outarg;
int err = -EINVAL; int err = -ENOMEM;
char buf[FUSE_NAME_MAX+1]; char *buf;
struct qstr name; struct qstr name;
buf = kzalloc(FUSE_NAME_MAX + 1, GFP_KERNEL);
if (!buf)
goto err;
err = -EINVAL;
if (size < sizeof(outarg)) if (size < sizeof(outarg))
goto err; goto err;
...@@ -910,16 +912,14 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size, ...@@ -910,16 +912,14 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
down_read(&fc->killsb); down_read(&fc->killsb);
err = -ENOENT; err = -ENOENT;
if (!fc->sb) if (fc->sb)
goto err_unlock;
err = fuse_reverse_inval_entry(fc->sb, outarg.parent, &name); err = fuse_reverse_inval_entry(fc->sb, outarg.parent, &name);
err_unlock:
up_read(&fc->killsb); up_read(&fc->killsb);
kfree(buf);
return err; return err;
err: err:
kfree(buf);
fuse_copy_finish(cs); fuse_copy_finish(cs);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment