xfs: Pull up trans roll in xfs_attr3_leaf_clearflag
authorAllison Collins <allison.henderson@oracle.com>
Tue, 21 Jul 2020 04:47:26 +0000 (21:47 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 29 Jul 2020 03:28:11 +0000 (20:28 -0700)
New delayed allocation routines cannot be handling transactions so
pull them out into the calling functions

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>
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_attr_leaf.c

index d3ab32d..2d84ab4 100644 (file)
@@ -709,6 +709,14 @@ xfs_attr_leaf_addname(
                 * Added a "remote" value, just clear the incomplete flag.
                 */
                error = xfs_attr3_leaf_clearflag(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);
        }
        return error;
 }
@@ -1067,6 +1075,14 @@ restart:
                error = xfs_attr3_leaf_clearflag(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;
        }
        retval = error = 0;
 
index 7c72ff5..8623c81 100644 (file)
@@ -2782,10 +2782,7 @@ xfs_attr3_leaf_clearflag(
                         XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
        }
 
-       /*
-        * Commit the flag value change and start the next trans in series.
-        */
-       return xfs_trans_roll_inode(&args->trans, args->dp);
+       return 0;
 }
 
 /*