Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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_...()
  • Loading branch information
torvalds committed Mar 3, 2010
2 parents b037bba + b2d82ee commit 60f8a8d
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,13 +865,10 @@ static int fuse_notify_inval_inode(struct fuse_conn *fc, unsigned int size,

down_read(&fc->killsb);
err = -ENOENT;
if (!fc->sb)
goto err_unlock;

err = fuse_reverse_inval_inode(fc->sb, outarg.ino,
outarg.off, outarg.len);

err_unlock:
if (fc->sb) {
err = fuse_reverse_inval_inode(fc->sb, outarg.ino,
outarg.off, outarg.len);
}
up_read(&fc->killsb);
return err;

Expand All @@ -884,10 +881,15 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
struct fuse_copy_state *cs)
{
struct fuse_notify_inval_entry_out outarg;
int err = -EINVAL;
char buf[FUSE_NAME_MAX+1];
int err = -ENOMEM;
char *buf;
struct qstr name;

buf = kzalloc(FUSE_NAME_MAX + 1, GFP_KERNEL);
if (!buf)
goto err;

err = -EINVAL;
if (size < sizeof(outarg))
goto err;

Expand All @@ -910,16 +912,14 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,

down_read(&fc->killsb);
err = -ENOENT;
if (!fc->sb)
goto err_unlock;

err = fuse_reverse_inval_entry(fc->sb, outarg.parent, &name);

err_unlock:
if (fc->sb)
err = fuse_reverse_inval_entry(fc->sb, outarg.parent, &name);
up_read(&fc->killsb);
kfree(buf);
return err;

err:
kfree(buf);
fuse_copy_finish(cs);
return err;
}
Expand Down

0 comments on commit 60f8a8d

Please sign in to comment.