Skip to content

Commit 89755dc

Browse files
Christoph HellwigChristoph Hellwig
authored andcommitted
hfsplus: protect readdir against removals from open_dir_list
We already have i_mutex for readdir and the namespace operations that add entries to open_dir_list, the only thing that was missing was the removal in hfsplus_dir_release. Signed-off-by: Christoph Hellwig <hch@tuxera.com>
1 parent 84adede commit 89755dc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/hfsplus/dir.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ static int hfsplus_dir_release(struct inode *inode, struct file *file)
231231
{
232232
struct hfsplus_readdir_data *rd = file->private_data;
233233
if (rd) {
234+
mutex_lock(&inode->i_mutex);
234235
list_del(&rd->list);
236+
mutex_unlock(&inode->i_mutex);
235237
kfree(rd);
236238
}
237239
return 0;

0 commit comments

Comments
 (0)