[PATCH] fix reiserfs lock inversion of bkl vs inode semaphore

The correct lock ordering is inode lock -> BKL

Signed-off-by: Chris Mason <mason@suse.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Chris Mason and committed by Linus Torvalds b5f3953c ebd15302

+2 -2
+1 -1
fs/reiserfs/file.c
··· 48 return 0; 49 } 50 51 - reiserfs_write_lock(inode->i_sb); 52 mutex_lock(&inode->i_mutex); 53 /* freeing preallocation only involves relogging blocks that 54 * are already in the current transaction. preallocation gets 55 * freed at the end of each transaction, so it is impossible for
··· 48 return 0; 49 } 50 51 mutex_lock(&inode->i_mutex); 52 + reiserfs_write_lock(inode->i_sb); 53 /* freeing preallocation only involves relogging blocks that 54 * are already in the current transaction. preallocation gets 55 * freed at the end of each transaction, so it is impossible for
+1 -1
fs/reiserfs/ioctl.c
··· 116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) { 117 return 0; 118 } 119 - reiserfs_write_lock(inode->i_sb); 120 121 /* we need to make sure nobody is changing the file size beneath 122 ** us 123 */ 124 mutex_lock(&inode->i_mutex); 125 126 write_from = inode->i_size & (blocksize - 1); 127 /* if we are on a block boundary, we are already unpacked. */
··· 116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) { 117 return 0; 118 } 119 120 /* we need to make sure nobody is changing the file size beneath 121 ** us 122 */ 123 mutex_lock(&inode->i_mutex); 124 + reiserfs_write_lock(inode->i_sb); 125 126 write_from = inode->i_size & (blocksize - 1); 127 /* if we are on a block boundary, we are already unpacked. */