[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>
This commit is contained in:
committed by
Linus Torvalds
parent
ebd15302dc
commit
b5f3953c10
@@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
reiserfs_write_lock(inode->i_sb);
|
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
|
reiserfs_write_lock(inode->i_sb);
|
||||||
/* freeing preallocation only involves relogging blocks that
|
/* freeing preallocation only involves relogging blocks that
|
||||||
* are already in the current transaction. preallocation gets
|
* are already in the current transaction. preallocation gets
|
||||||
* freed at the end of each transaction, so it is impossible for
|
* freed at the end of each transaction, so it is impossible for
|
||||||
|
@@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
|
|||||||
if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
|
if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
reiserfs_write_lock(inode->i_sb);
|
|
||||||
|
|
||||||
/* we need to make sure nobody is changing the file size beneath
|
/* we need to make sure nobody is changing the file size beneath
|
||||||
** us
|
** us
|
||||||
*/
|
*/
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
|
reiserfs_write_lock(inode->i_sb);
|
||||||
|
|
||||||
write_from = inode->i_size & (blocksize - 1);
|
write_from = inode->i_size & (blocksize - 1);
|
||||||
/* if we are on a block boundary, we are already unpacked. */
|
/* if we are on a block boundary, we are already unpacked. */
|
||||||
|
Reference in New Issue
Block a user