diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-10-01 03:45:25 (GMT) |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-10-01 03:45:25 (GMT) |
commit | 89755dcace09b44b3aa024bf302d9b19b4c24cad (patch) | |
tree | 8626891db36b01a3ff3ac80967ce08aef988d1f7 /fs/hfsplus | |
parent | 84adede31267af37141da2b2b04293c5ea8af7ae (diff) | |
download | linux-fsl-qoriq-89755dcace09b44b3aa024bf302d9b19b4c24cad.tar.xz |
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>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r-- | fs/hfsplus/dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 1c81eed..93fa45c 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -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; |