[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>
This commit is contained in:

committed by
Linus Torvalds

parent
7762f5a0b7
commit
8da5ff23ce
@@ -195,7 +195,9 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
|
||||
}
|
||||
|
||||
fi = get_fuse_inode(inode);
|
||||
spin_lock(&fc->lock);
|
||||
fi->nlookup ++;
|
||||
spin_unlock(&fc->lock);
|
||||
fuse_change_attributes(inode, attr);
|
||||
return inode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user