mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
udf: Fix deadlock in udf_release_file()
udf_release_file() can be called from munmap() path with mmap_sem held. Thus we cannot take i_mutex there because that ranks above mmap_sem. Luckily, i_mutex is not needed in udf_release_file() anymore since protection by i_data_sem is enough to protect from races with write and truncate. Reported-by: Al Viro <[email protected]> Reviewed-by: Namjae Jeon <[email protected]> Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
978d6d8c45
commit
f6940fe909
1 changed files with 0 additions and 2 deletions
|
|
@ -201,12 +201,10 @@ out:
|
|||
static int udf_release_file(struct inode *inode, struct file *filp)
|
||||
{
|
||||
if (filp->f_mode & FMODE_WRITE) {
|
||||
mutex_lock(&inode->i_mutex);
|
||||
down_write(&UDF_I(inode)->i_data_sem);
|
||||
udf_discard_prealloc(inode);
|
||||
udf_truncate_tail_extent(inode);
|
||||
up_write(&UDF_I(inode)->i_data_sem);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue