Skip to content

Commit

Permalink
Btrfs: fix lockdep warning
Browse files Browse the repository at this point in the history
The locking order for stuff is

__sb_start_write
ordered_mutex

but with sync() we don't do __sb_start_write for some strange reason, which
means that our iput in wait_ordered_extents could start a transaction which does
the __sb_start_write while we're holding the ordered_mutex.  Fix this by using
delayed iput in sync.  Thanks,

Reported-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Josef Bacik committed May 6, 2013
1 parent 534e662 commit 62dbd71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ int btrfs_sync_fs(struct super_block *sb, int wait)
return 0;
}

btrfs_wait_ordered_extents(root, 0);
btrfs_wait_ordered_extents(root, 1);

trans = btrfs_attach_transaction_barrier(root);
if (IS_ERR(trans)) {
Expand Down

0 comments on commit 62dbd71

Please sign in to comment.