summaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-05-13 02:02:09 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-13 02:08:40 +0200
commit323ee8fc544d407eb053471b9607f95f987f5f12 (patch)
tree7185ea5c3d7b5d08492bd93bb714bc5338b5355c /fs/hfsplus/inode.c
parenthostfs: switch to ->iterate_shared() (diff)
downloadlinux-323ee8fc544d407eb053471b9607f95f987f5f12.tar.xz
linux-323ee8fc544d407eb053471b9607f95f987f5f12.zip
hfsplus: switch to ->iterate_shared()
We need to protect the list of hfsplus_readdir_data against parallel insertions (in readdir) and removals (in release). Add a spinlock for that. Note that it has nothing to do with protection of hfsplus_readdir_data->key - we have an exclusion between hfsplus_readdir() and hfsplus_delete_cat() on directory lock and between several hfsplus_readdir() for the same struct file on ->f_pos_lock. The spinlock is strictly for list changes. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hfsplus/inode.c')
-rw-r--r--fs/hfsplus/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index b28f39865c3a..037f738c5871 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -374,6 +374,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, umode_t mode)
hip = HFSPLUS_I(inode);
INIT_LIST_HEAD(&hip->open_dir_list);
+ spin_lock_init(&hip->open_dir_lock);
mutex_init(&hip->extents_lock);
atomic_set(&hip->opencnt, 0);
hip->extent_state = 0;