]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/btrfs/transaction.c
Merge tag 'wireless-drivers-2020-02-08' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / fs / btrfs / transaction.c
index 55d8fd68775aa065c2027a20a34856067506c756..33dcc88b428ad402ed68c1dd6bbfb9dc9ee69d23 100644 (file)
@@ -2015,6 +2015,14 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 
        ASSERT(refcount_read(&trans->use_count) == 1);
 
+       /*
+        * 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(READ_ONCE(cur_trans->aborted))) {
                ret = cur_trans->aborted;