]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: Pull up trans handling in xfs_attr3_leaf_flipflags
authorAllison Collins <allison.henderson@oracle.com>
Tue, 15 Sep 2020 19:59:36 +0000 (15:59 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 15 Sep 2020 19:59:36 +0000 (15:59 -0400)
Source kernel commit: e3be1272ddaf5f7482008578b467cf0ca8c35695

Since delayed operations cannot roll transactions, pull up the
transaction handling into the calling function

Signed-off-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_attr.c
libxfs/xfs_attr_leaf.c

index 3d71c275aa2e0badc44a73b08871681b578899a0..42c450920d18db23af461dc4a66e2a4890b7ba37 100644 (file)
@@ -620,6 +620,13 @@ xfs_attr_leaf_addname(
                 * "old" attr and clear the incomplete flag on the "new" attr.
                 */
                error = xfs_attr3_leaf_flipflags(args);
+               if (error)
+                       return error;
+               /*
+                * Commit the flag value change and start the next trans in
+                * series.
+                */
+               error = xfs_trans_roll_inode(&args->trans, args->dp);
                if (error)
                        return error;
 
@@ -961,6 +968,13 @@ restart:
                 * "old" attr and clear the incomplete flag on the "new" attr.
                 */
                error = xfs_attr3_leaf_flipflags(args);
+               if (error)
+                       goto out;
+               /*
+                * Commit the flag value change and start the next trans in
+                * series
+                */
+               error = xfs_trans_roll_inode(&args->trans, args->dp);
                if (error)
                        goto out;
 
index 5bef0ae825ba7c051be68f6b29afe05167fa18d1..1783dd702ea6a5acba5e4ad5245c18892892035a 100644 (file)
@@ -2948,10 +2948,5 @@ xfs_attr3_leaf_flipflags(
                         XFS_DA_LOGRANGE(leaf2, name_rmt, sizeof(*name_rmt)));
        }
 
-       /*
-        * Commit the flag value change and start the next trans in series.
-        */
-       error = xfs_trans_roll_inode(&args->trans, args->dp);
-
-       return error;
+       return 0;
 }