Commit c9d8f5f0 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Miklos Szeredi

fuse: Protect fi->nlookup with fi->lock

This continues previous patch and introduces the same protection for
nlookup field.
Signed-off-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent f15ecfef
...@@ -207,9 +207,9 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) ...@@ -207,9 +207,9 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
fuse_queue_forget(fc, forget, outarg.nodeid, 1); fuse_queue_forget(fc, forget, outarg.nodeid, 1);
goto invalid; goto invalid;
} }
spin_lock(&fc->lock); spin_lock(&fi->lock);
fi->nlookup++; fi->nlookup++;
spin_unlock(&fc->lock); spin_unlock(&fi->lock);
} }
kfree(forget); kfree(forget);
if (ret == -ENOMEM) if (ret == -ENOMEM)
......
...@@ -325,9 +325,9 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, ...@@ -325,9 +325,9 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
} }
fi = get_fuse_inode(inode); fi = get_fuse_inode(inode);
spin_lock(&fc->lock); spin_lock(&fi->lock);
fi->nlookup++; fi->nlookup++;
spin_unlock(&fc->lock); spin_unlock(&fi->lock);
fuse_change_attributes(inode, attr, attr_valid, attr_version); fuse_change_attributes(inode, attr, attr_valid, attr_version);
return inode; return inode;
......
...@@ -213,9 +213,9 @@ static int fuse_direntplus_link(struct file *file, ...@@ -213,9 +213,9 @@ static int fuse_direntplus_link(struct file *file,
} }
fi = get_fuse_inode(inode); fi = get_fuse_inode(inode);
spin_lock(&fc->lock); spin_lock(&fi->lock);
fi->nlookup++; fi->nlookup++;
spin_unlock(&fc->lock); spin_unlock(&fi->lock);
forget_all_cached_acls(inode); forget_all_cached_acls(inode);
fuse_change_attributes(inode, &o->attr, fuse_change_attributes(inode, &o->attr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment