From: Al Viro Date: Mon, 6 May 2013 00:20:25 +0000 (-0400) Subject: hfs: SMP race on directory close() X-Git-Tag: submit/tizen_common/20140905.094502~2954^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1950267e6e9dc2531f2790bf217aa7aadc9aa324;p=sdk%2Femulator%2Femulator-kernel.git hfs: SMP race on directory close() ->open_dir_list needs protection... Signed-off-by: Al Viro --- diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 17c22a8fd40a..e0101b6fb0d7 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -176,7 +176,9 @@ static int hfs_dir_release(struct inode *inode, struct file *file) { struct hfs_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;