diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-10-17 09:10:08 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-17 17:18:45 +0200 |
commit | 8da5ff23ce0a84d9845b01e6fe5047e17836bf5a (patch) | |
tree | dc711306a3793c91a5df7fc0223738a40ea3fb7c /fs/fuse/dir.c | |
parent | [PATCH] document i_size_write locking rules (diff) | |
download | linux-8da5ff23ce0a84d9845b01e6fe5047e17836bf5a.tar.xz linux-8da5ff23ce0a84d9845b01e6fe5047e17836bf5a.zip |
[PATCH] fuse: locking fix for nlookup
An inode could be returned by independent parallel lookups, in this case an
update of the lookup counter could be lost resulting in a memory leak in
userspace.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index a8f65c11aa2c..7ecfe95795cd 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -163,7 +163,9 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) fuse_send_forget(fc, req, outarg.nodeid, 1); return 0; } + spin_lock(&fc->lock); fi->nlookup ++; + spin_unlock(&fc->lock); } fuse_put_request(fc, req); if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT) |