diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-12 20:02:09 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-12 20:08:40 -0400 |
commit | 323ee8fc544d407eb053471b9607f95f987f5f12 (patch) | |
tree | 7185ea5c3d7b5d08492bd93bb714bc5338b5355c /fs/hfsplus/super.c | |
parent | 552a9d489f1412beb5914f0c64a54d921a9c6624 (diff) | |
download | lwn-323ee8fc544d407eb053471b9607f95f987f5f12.tar.gz lwn-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/super.c')
-rw-r--r-- | fs/hfsplus/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index c35911362ff9..755bf30ba1ce 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -67,6 +67,7 @@ struct inode *hfsplus_iget(struct super_block *sb, unsigned long ino) return inode; INIT_LIST_HEAD(&HFSPLUS_I(inode)->open_dir_list); + spin_lock_init(&HFSPLUS_I(inode)->open_dir_lock); mutex_init(&HFSPLUS_I(inode)->extents_lock); HFSPLUS_I(inode)->flags = 0; HFSPLUS_I(inode)->extent_state = 0; |