hfs: SMP race on directory close()

->open_dir_list needs protection...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2013-05-05 20:20:25 -04:00
parent f8ce1faf55
commit 1950267e6e
1 changed files with 2 additions and 0 deletions

View File

@ -176,7 +176,9 @@ static int hfs_dir_release(struct inode *inode, struct file *file)
{ {
struct hfs_readdir_data *rd = file->private_data; struct hfs_readdir_data *rd = file->private_data;
if (rd) { if (rd) {
mutex_lock(&inode->i_mutex);
list_del(&rd->list); list_del(&rd->list);
mutex_unlock(&inode->i_mutex);
kfree(rd); kfree(rd);
} }
return 0; return 0;