Skip to content

Commit 0f89edc

Browse files
allisonhendersondjwong
authored andcommitted
xfs: Lift -ENOSPC handler from xfs_attr_leaf_addname
Lift -ENOSPC handler from xfs_attr_leaf_addname. This will help to reorganize transitions between the attr forms later. Signed-off-by: Allison Collins <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Brian Foster <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]> Acked-by: Dave Chinner <[email protected]>
1 parent bf4a5cf commit 0f89edc

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

fs/xfs/libxfs/xfs_attr.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,13 @@ xfs_attr_set_args(
298298
if (error != -ENOSPC)
299299
return error;
300300

301+
/*
302+
* Promote the attribute list to the Btree format.
303+
*/
304+
error = xfs_attr3_leaf_to_node(args);
305+
if (error)
306+
return error;
307+
301308
/*
302309
* Finish any deferred work items and roll the transaction once
303310
* more. The goal here is to call node_addname with the inode
@@ -603,7 +610,7 @@ xfs_attr_leaf_try_add(
603610
struct xfs_da_args *args,
604611
struct xfs_buf *bp)
605612
{
606-
int retval, error;
613+
int retval;
607614

608615
/*
609616
* Look up the given attribute in the leaf block. Figure out if
@@ -635,20 +642,10 @@ xfs_attr_leaf_try_add(
635642
}
636643

637644
/*
638-
* Add the attribute to the leaf block, transitioning to a Btree
639-
* if required.
645+
* Add the attribute to the leaf block
640646
*/
641-
retval = xfs_attr3_leaf_add(bp, args);
642-
if (retval == -ENOSPC) {
643-
/*
644-
* Promote the attribute list to the Btree format. Unless an
645-
* error occurs, retain the -ENOSPC retval
646-
*/
647-
error = xfs_attr3_leaf_to_node(args);
648-
if (error)
649-
return error;
650-
}
651-
return retval;
647+
return xfs_attr3_leaf_add(bp, args);
648+
652649
out_brelse:
653650
xfs_trans_brelse(args->trans, bp);
654651
return retval;

0 commit comments

Comments
 (0)