Re: [PATCH 04/16] xfs: separate out initial attr_set states

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 21, 2022 at 05:38:03PM -0700, Alli wrote:
> On Thu, 2022-04-14 at 19:44 +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> > 
> > We current use XFS_DAS_UNINIT for several steps in the attr_set
> > state machine. We use it for setting shortform xattrs, converting
> > from shortform to leaf, leaf add, leaf-to-node and leaf add. All of
> > these things are essentially known before we start the state machine
> > iterating, so we really should separate them out:
> > 
> > XFS_DAS_SF_ADD:
> > 	- tries to do a shortform add
> > 	- on success -> done
> > 	- on ENOSPC converts to leaf, -> XFS_DAS_LEAF_ADD
> > 	- on error, dies.
> > 
> > XFS_DAS_LEAF_ADD:
> > 	- tries to do leaf add
> > 	- on success:
> > 		- inline attr -> done
> > 		- remote xattr || REPLACE -> XFS_DAS_FOUND_LBLK
> > 	- on ENOSPC converts to node, -> XFS_DAS_NODE_ADD
> > 	- on error, dies
> > 
> > XFS_DAS_NODE_ADD:
> > 	- tries to do node add
> > 	- on success:
> > 		- inline attr -> done
> > 		- remote xattr || REPLACE -> XFS_DAS_FOUND_NBLK
> > 	- on error, dies
....
> > @@ -874,6 +884,13 @@ xfs_attr_set_deferred(
> >  	if (error)
> >  		return error;
> >  
> > +	if (xfs_attr_is_shortform(args->dp))
> > +		new->xattri_dela_state = XFS_DAS_SF_ADD;
> > +	else if (xfs_attr_is_leaf(args->dp))
> > +		new->xattri_dela_state = XFS_DAS_LEAF_ADD;
> > +	else
> > +		new->xattri_dela_state = XFS_DAS_NODE_ADD;
> > +
> Mmmm, I dont know about putting this part here, because the
> xfs_attr_*_deferred routines do not get called during a replay, so this
> initial state config would get missed.  If you scoot it up into
> the xfs_attr_item_init call just a few lines up, then things should be
> fine since both code path start with that.  Rest looks ok though.

Yeah, recovery gets fixed up later on in the patchset. I managed
to get this through several rounds of fstests auto group and
several iterations of recoveryloop testing before I actually had
recovery hit the ASSERT(state != XFS_DAS_UNINIT) case....

I'm just getting back to this series now, so I'll look to clean this
aspect of it up.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux