udf: Fix deadlock in udf_release_file()
authorJan Kara <jack@suse.cz>
Mon, 20 Feb 2012 16:54:00 +0000 (17:54 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 10 Mar 2012 21:05:38 +0000 (16:05 -0500)
commitf6940fe9092e796119af691c7f722c252f4fc524
tree648da154cc48352b12982b4407e72121ceac9ecb
parent978d6d8c4574098050b22281b9ed06818c0b23ca
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 <viro@ZenIV.linux.org.uk>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/udf/file.c