aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.c
diff options
context:
space:
mode:
authorLatchesar Ionkov <lucho@ionkov.net>2007-04-23 17:41:11 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-24 11:23:08 -0400
commitc959df9f01cfb2f43b4d1f58631ee1e9c50541b6 (patch)
tree79d8d52914ed1f8a96f124f267ebe44c1630e3b4 /fs/9p/vfs_inode.c
parentf51a5a9de86a948b9a30daab90fb003f51446dcd (diff)
v9fs: don't use primary fid when removing file
v9fs_insert uses v9fs_fid_lookup (which also locks the fid) to get the primary fid associated with the dentry and destroys the v9fs_fid struct after removing the file. If another process called v9fs_fid_lookup on the same dentry, it may wait undefinitely for the fid's lock (as the struct is freed). This patch changes v9fs_remove to use a cloned fid, so the primary fid is not locked and freed. Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Cc: Eric Van Hensbergen <ericvh@hera.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r--fs/9p/vfs_inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 124a085d1f2e..b01b0a457932 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -415,7 +415,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir)
415 file_inode = file->d_inode; 415 file_inode = file->d_inode;
416 sb = file_inode->i_sb; 416 sb = file_inode->i_sb;
417 v9ses = v9fs_inode2v9ses(file_inode); 417 v9ses = v9fs_inode2v9ses(file_inode);
418 v9fid = v9fs_fid_lookup(file); 418 v9fid = v9fs_fid_clone(file);
419 if(IS_ERR(v9fid)) 419 if(IS_ERR(v9fid))
420 return PTR_ERR(v9fid); 420 return PTR_ERR(v9fid);
421 421