Skip to content

Commit c9d8f5f

Browse files
Kirill TkhaiMiklos Szeredi
authored andcommitted
fuse: Protect fi->nlookup with fi->lock
This continues previous patch and introduces the same protection for nlookup field. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent f15ecfe commit c9d8f5f

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎fs/fuse/dir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
207207
fuse_queue_forget(fc, forget, outarg.nodeid, 1);
208208
goto invalid;
209209
}
210-
spin_lock(&fc->lock);
210+
spin_lock(&fi->lock);
211211
fi->nlookup++;
212-
spin_unlock(&fc->lock);
212+
spin_unlock(&fi->lock);
213213
}
214214
kfree(forget);
215215
if (ret == -ENOMEM)

‎fs/fuse/inode.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
325325
}
326326

327327
fi = get_fuse_inode(inode);
328-
spin_lock(&fc->lock);
328+
spin_lock(&fi->lock);
329329
fi->nlookup++;
330-
spin_unlock(&fc->lock);
330+
spin_unlock(&fi->lock);
331331
fuse_change_attributes(inode, attr, attr_valid, attr_version);
332332

333333
return inode;

‎fs/fuse/readdir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ static int fuse_direntplus_link(struct file *file,
213213
}
214214

215215
fi = get_fuse_inode(inode);
216-
spin_lock(&fc->lock);
216+
spin_lock(&fi->lock);
217217
fi->nlookup++;
218-
spin_unlock(&fc->lock);
218+
spin_unlock(&fi->lock);
219219

220220
forget_all_cached_acls(inode);
221221
fuse_change_attributes(inode, &o->attr,

0 commit comments

Comments
 (0)