On Tue, Jul 03, 2018 at 07:15:04PM -0700, Darrick J. Wong wrote: > On Wed, Jun 27, 2018 at 01:21:23PM +1000, Dave Chinner wrote: > > On Sun, Jun 24, 2018 at 12:24:07PM -0700, Darrick J. Wong wrote: > > > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > > > > > Rebuild the free space btrees from the gaps in the rmap btree. > > > > > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > > --- > > ...... > > > + if (error) > > > + goto err; > > > + xfs_repair_cancel_btree_extents(sc, &ra.nobtlist); > > > + return 0; > > > + > > > +err: > > > + xfs_repair_cancel_btree_extents(sc, &ra.nobtlist); > > > + if (cur) > > > + xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); > > > + return error; > > > > Error stacking here can be cleaned up - we don't need an extra stack > > as the cursor is NULL when finished with. Hence it could just be: > > > > /* Compute the old bnobt/cntbt blocks. */ > > error = xfs_repair_subtract_extents(sc, old_allocbt_blocks, > > &ra.nobtlist); > > err: > > xfs_repair_cancel_btree_extents(sc, &ra.nobtlist); > > if (cur) > > xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); > > TBH I've been tempted for years to refactor this thing to take error > directly rather than require this XFS_BTREE_{NO,}ERROR business. > There's only two choices, and we nearly always decide using error == 0. Yeah, that would make for a nice cleanup. Add it to the TODO list? Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html