summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-10-17 00:10:09 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 08:18:45 -0700
commit265126ba9e1f8e217e61d1017c6609f76828aa7a (patch)
tree27eeee59ad960f3c31d589caeb69f988bf4e78ce /fs/fuse
parent8da5ff23ce0a84d9845b01e6fe5047e17836bf5a (diff)
downloadlinux-265126ba9e1f8e217e61d1017c6609f76828aa7a.tar.bz2
[PATCH] fuse: fix spurious BUG
Fix a spurious BUG in an unlikely race, where at least three parallel lookups return the same inode, but with different file type. This has not yet been observed in real life. Allowing unlimited retries could delay fuse_iget() indefinitely, but this is really for the broken userspace filesystem to worry about. 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')
-rw-r--r--fs/fuse/inode.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index e9114237f31f..4ee8f72e6380 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -172,7 +172,6 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
struct inode *inode;
struct fuse_inode *fi;
struct fuse_conn *fc = get_fuse_conn_super(sb);
- int retried = 0;
retry:
inode = iget5_locked(sb, nodeid, fuse_inode_eq, fuse_inode_set, &nodeid);
@@ -186,11 +185,9 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
fuse_init_inode(inode, attr);
unlock_new_inode(inode);
} else if ((inode->i_mode ^ attr->mode) & S_IFMT) {
- BUG_ON(retried);
/* Inode has changed type, any I/O on the old should fail */
make_bad_inode(inode);
iput(inode);
- retried = 1;
goto retry;
}