OSDN Git Service

Merge tag 'v4.4.214' into 10
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / btrfs / transaction.c
index 0980163..64e449e 100644 (file)
@@ -1814,6 +1814,14 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
        struct btrfs_inode *btree_ino = BTRFS_I(root->fs_info->btree_inode);
        int ret;
 
+       /*
+        * Some places just start a transaction to commit it.  We need to make
+        * sure that if this commit fails that the abort code actually marks the
+        * transaction as failed, so set trans->dirty to make the abort code do
+        * the right thing.
+        */
+       trans->dirty = true;
+
        /* Stop the commit early if ->aborted is set */
        if (unlikely(ACCESS_ONCE(cur_trans->aborted))) {
                ret = cur_trans->aborted;