Skip to content

Commit b5f3953

Browse files
Chris MasonLinus Torvalds
authored andcommitted
[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>
1 parent ebd1530 commit b5f3953

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/reiserfs/file.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
4848
return 0;
4949
}
5050

51-
reiserfs_write_lock(inode->i_sb);
5251
mutex_lock(&inode->i_mutex);
52+
reiserfs_write_lock(inode->i_sb);
5353
/* freeing preallocation only involves relogging blocks that
5454
* are already in the current transaction. preallocation gets
5555
* freed at the end of each transaction, so it is impossible for

‎fs/reiserfs/ioctl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
116116
if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
117117
return 0;
118118
}
119-
reiserfs_write_lock(inode->i_sb);
120119

121120
/* we need to make sure nobody is changing the file size beneath
122121
** us
123122
*/
124123
mutex_lock(&inode->i_mutex);
124+
reiserfs_write_lock(inode->i_sb);
125125

126126
write_from = inode->i_size & (blocksize - 1);
127127
/* if we are on a block boundary, we are already unpacked. */

0 commit comments

Comments
 (0)