Btrfs: reset intwrite on transaction abort
authorJosef Bacik <jbacik@fusionio.com>
Sat, 21 Sep 2013 02:26:29 +0000 (22:26 -0400)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 02:53:29 +0000 (21:53 -0500)
If we abort a transaction in the middle of a commit we weren't undoing the
intwrite locking.  This patch fixes that problem.

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/transaction.c

index 8c81bdc1ef9bae82c92e5a8836a0f911c1547a55..7138d6a3726e6d63df6def0107968a5800d92182 100644 (file)
@@ -1552,6 +1552,8 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans,
                root->fs_info->running_transaction = NULL;
        spin_unlock(&root->fs_info->trans_lock);
 
+       if (trans->type & __TRANS_FREEZABLE)
+               sb_end_intwrite(root->fs_info->sb);
        put_transaction(cur_trans);
        put_transaction(cur_trans);