Skip to content

Commit

Permalink
[PATCH] fix reiserfs lock inversion of bkl vs inode semaphore
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Mason authored and Linus Torvalds committed Aug 6, 2006
1 parent ebd1530 commit b5f3953
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/reiserfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
return 0;
}

reiserfs_write_lock(inode->i_sb);
mutex_lock(&inode->i_mutex);
reiserfs_write_lock(inode->i_sb);
/* freeing preallocation only involves relogging blocks that
* are already in the current transaction. preallocation gets
* freed at the end of each transaction, so it is impossible for
Expand Down
2 changes: 1 addition & 1 deletion fs/reiserfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)
if (REISERFS_I(inode)->i_flags & i_nopack_mask) {
return 0;
}
reiserfs_write_lock(inode->i_sb);

/* we need to make sure nobody is changing the file size beneath
** us
*/
mutex_lock(&inode->i_mutex);
reiserfs_write_lock(inode->i_sb);

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

0 comments on commit b5f3953

Please sign in to comment.