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