Skip to content

Commit e3be127

Browse files
allisonhendersondjwong
authored andcommitted
xfs: Pull up trans handling in xfs_attr3_leaf_flipflags
Since delayed operations cannot roll transactions, pull up the transaction handling into the calling function Signed-off-by: Allison Collins <[email protected]> Reviewed-by: Brian Foster <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Chandan Rajendra <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]> Acked-by: Dave Chinner <[email protected]>
1 parent 1a485fc commit e3be127

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

fs/xfs/libxfs/xfs_attr.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,13 @@ xfs_attr_leaf_addname(
620620
* "old" attr and clear the incomplete flag on the "new" attr.
621621
*/
622622
error = xfs_attr3_leaf_flipflags(args);
623+
if (error)
624+
return error;
625+
/*
626+
* Commit the flag value change and start the next trans in
627+
* series.
628+
*/
629+
error = xfs_trans_roll_inode(&args->trans, args->dp);
623630
if (error)
624631
return error;
625632

@@ -961,6 +968,13 @@ xfs_attr_node_addname(
961968
* "old" attr and clear the incomplete flag on the "new" attr.
962969
*/
963970
error = xfs_attr3_leaf_flipflags(args);
971+
if (error)
972+
goto out;
973+
/*
974+
* Commit the flag value change and start the next trans in
975+
* series
976+
*/
977+
error = xfs_trans_roll_inode(&args->trans, args->dp);
964978
if (error)
965979
goto out;
966980

fs/xfs/libxfs/xfs_attr_leaf.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,10 +2951,5 @@ xfs_attr3_leaf_flipflags(
29512951
XFS_DA_LOGRANGE(leaf2, name_rmt, sizeof(*name_rmt)));
29522952
}
29532953

2954-
/*
2955-
* Commit the flag value change and start the next trans in series.
2956-
*/
2957-
error = xfs_trans_roll_inode(&args->trans, args->dp);
2958-
2959-
return error;
2954+
return 0;
29602955
}

0 commit comments

Comments
 (0)