Skip to content

Commit

Permalink
hfsplus: protect readdir against removals from open_dir_list
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Christoph Hellwig committed Oct 1, 2010
1 parent 84adede commit 89755dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/hfsplus/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ static int hfsplus_dir_release(struct inode *inode, struct file *file)
{
struct hfsplus_readdir_data *rd = file->private_data;
if (rd) {
mutex_lock(&inode->i_mutex);
list_del(&rd->list);
mutex_unlock(&inode->i_mutex);
kfree(rd);
}
return 0;
Expand Down

0 comments on commit 89755dc

Please sign in to comment.