linux-stable/fs/udf
Jan Kara d2eb8c3593 udf: Fix deadlock when converting file from in-ICB one to normal one
During BKL removal in 2.6.38, conversion of files from in-ICB format to normal
format got broken. We call ->writepage with i_data_sem held but udf_get_block()
also acquires i_data_sem thus creating A-A deadlock.

We fix the problem by dropping i_data_sem before calling ->writepage() which is
safe since i_mutex still protects us against any changes in the file. Also fix
pagelock - i_data_sem lock inversion in udf_expand_file_adinicb() by dropping
i_data_sem before calling find_or_create_page().

CC: stable@kernel.org
Reported-by: Matthias Matiak <netzpython@mail-on.us>
Tested-by: Matthias Matiak <netzpython@mail-on.us>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09 13:52:08 +01:00
..
balloc.c udf: Neaten udf_debug uses 2011-10-31 23:43:58 +01:00
dir.c udf: Remove unnecessary bkl usages 2011-01-06 17:03:57 +01:00
directory.c udf: Neaten udf_debug uses 2011-10-31 23:43:58 +01:00
ecma_167.h Remove struct typedefs from fs/udf/ecma_167.h et al. 2009-04-02 12:29:47 +02:00
file.c udf: Fix deadlock when converting file from in-ICB one to normal one 2012-01-09 13:52:08 +01:00
ialloc.c udf: Move handling of uniqueID into a helper function and protect it by a s_alloc_mutex 2011-01-06 17:03:55 +01:00
inode.c udf: Fix deadlock when converting file from in-ICB one to normal one 2012-01-09 13:52:08 +01:00
Kconfig Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6 2011-01-11 14:45:52 -08:00
lowlevel.c udf: Neaten udf_debug uses 2011-10-31 23:43:58 +01:00
Makefile switch udf to simple_fsync() 2009-06-11 21:36:13 -04:00
misc.c udf: Rename udf_error to udf_err 2011-10-10 19:29:01 +02:00
namei.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue 2011-11-02 11:41:01 -07:00
osta_udf.h Remove struct typedefs from fs/udf/ecma_167.h et al. 2009-04-02 12:29:47 +02:00
partition.c udf: Cleanup metadata flags handling 2011-10-31 23:49:48 +01:00
super.c udf: Cleanup metadata flags handling 2011-10-31 23:49:48 +01:00
symlink.c udf: Replace bkl with the UDF_I(inode)->i_data_sem for protect udf_inode_info struct 2011-01-06 17:03:56 +01:00
truncate.c udf: Convert printks to pr_<level> 2011-10-31 23:43:52 +01:00
udf_i.h udf: Replace bkl with the UDF_I(inode)->i_data_sem for protect udf_inode_info struct 2011-01-06 17:03:56 +01:00
udf_sb.h udf: Cleanup metadata flags handling 2011-10-31 23:49:48 +01:00
udfdecl.h Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs 2011-11-02 10:05:22 -07:00
udfend.h Remove struct typedefs from fs/udf/ecma_167.h et al. 2009-04-02 12:29:47 +02:00
udftime.c udf: Convert printks to pr_<level> 2011-10-31 23:43:52 +01:00
unicode.c udf: Convert printks to pr_<level> 2011-10-31 23:43:52 +01:00