public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alli <allison.henderson@oracle.com>
To: Dave Chinner <david@fromorbit.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 16/17] xfs: use XFS_DA_OP flags in deferred attr ops
Date: Tue, 10 May 2022 15:31:28 -0700	[thread overview]
Message-ID: <fe70c43373e1658d72b728319a42c68c19b69451.camel@oracle.com> (raw)
In-Reply-To: <20220509081738.GO1098723@dread.disaster.area>

On Mon, 2022-05-09 at 18:17 +1000, Dave Chinner wrote:
> On Fri, May 06, 2022 at 07:45:52PM +1000, Dave Chinner wrote:
> > @@ -1357,46 +1370,45 @@ xfs_attr_node_hasname(
> >  
> >  STATIC int
> >  xfs_attr_node_addname_find_attr(
> > -	 struct xfs_attr_item		*attr)
> > +	 struct xfs_attr_item	*attr)
> >  {
> > -	struct xfs_da_args		*args = attr->xattri_da_args;
> > -	int				retval;
> > +	struct xfs_da_args	*args = attr->xattri_da_args;
> > +	int			error;
> >  
> >  	/*
> >  	 * Search to see if name already exists, and get back a pointer
> >  	 * to where it should go.
> >  	 */
> > -	retval = xfs_attr_node_hasname(args, &attr->xattri_da_state);
> > -	if (retval != -ENOATTR && retval != -EEXIST)
> > -		goto error;
> > -
> > -	if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
> > -		goto error;
> > -	if (retval == -EEXIST) {
> > -		if (args->attr_flags & XATTR_CREATE)
> > +	error = xfs_attr_node_hasname(args, &attr->xattri_da_state);
> > +	switch (error) {
> > +	case -ENOATTR:
> > +		if (args->op_flags & XFS_DA_OP_REPLACE)
> > +			goto error;
> > +		break;
> > +	case -EEXIST:
> > +		if (!(args->op_flags & XFS_DA_OP_REPLACE))
> >  			goto error;
> >  
> > -		trace_xfs_attr_node_replace(args);
> > -
> > -		/* save the attribute state for later removal*/
> > -		args->op_flags |= XFS_DA_OP_RENAME;	/* atomic rename op
> > */
> > -		xfs_attr_save_rmt_blk(args);
> >  
> > +		trace_xfs_attr_node_replace(args);
> >  		/*
> > -		 * clear the remote attr state now that it is saved so
> > that the
> > -		 * values reflect the state of the attribute we are
> > about to
> > +		 * Save the existing remote attr state so that the
> > current
> > +		 * values reflect the state of the new attribute we are
> > about to
> >  		 * add, not the attribute we just found and will remove
> > later.
> >  		 */
> > -		args->rmtblkno = 0;
> > -		args->rmtblkcnt = 0;
> > -		args->rmtvaluelen = 0;
> > +		xfs_attr_save_rmt_blk(args);
> 
> Ok, removing the rmtblk zeroing right there is a bug. Not sure how I
> introduced that, or why it didn't show up until this afternoon. The
> leaf version of this same code is correct, and it triggers on
> generic/026 when larp = 0 but not when larp = 1.
> 
> I've fixed it, but vger is constipated again and I patches sent 8
> hours ago haven't reached the list yet so when I arrives I'll post
> an updated version of this patch against it....
> 
> Cheers,
> 
> Dave.
Alrighty, this part aside, I think this patch looks ok.  I've applied
this set, plus a small manual fix to put back the rmtblk zeroing, and
things seem to be running ok for me now.
  
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>





  reply	other threads:[~2022-05-10 22:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  9:45 Dave Chinner
2022-05-06  9:45 ` [PATCH 01/17] xfs: avoid empty xattr transaction when attrs are inline Dave Chinner
2022-05-06  9:45 ` [PATCH 02/17] xfs: initialise attrd item to zero Dave Chinner
2022-05-06  9:45 ` [PATCH 03/17] xfs: make xattri_leaf_bp more useful Dave Chinner
2022-05-06  9:45 ` [PATCH 04/17] xfs: rework deferred attribute operation setup Dave Chinner
2022-05-06 23:43   ` Alli
2022-05-06  9:45 ` [PATCH 05/17] xfs: separate out initial attr_set states Dave Chinner
2022-05-06 23:44   ` Alli
2022-05-06  9:45 ` [PATCH 06/17] xfs: kill XFS_DAC_LEAF_ADDNAME_INIT Dave Chinner
2022-05-06  9:45 ` [PATCH 07/17] xfs: consolidate leaf/node states in xfs_attr_set_iter Dave Chinner
2022-05-06  9:45 ` [PATCH 08/17] xfs: split remote attr setting out from replace path Dave Chinner
2022-05-06  9:45 ` [PATCH 09/17] xfs: XFS_DAS_LEAF_REPLACE state only needed if !LARP Dave Chinner
2022-05-06 23:44   ` Alli
2022-05-06  9:45 ` [PATCH 10/17] xfs: remote xattr removal in xfs_attr_set_iter() is conditional Dave Chinner
2022-05-06  9:45 ` [PATCH 11/17] xfs: clean up final attr removal in xfs_attr_set_iter Dave Chinner
2022-05-06  9:45 ` [PATCH 12/17] xfs: xfs_attr_set_iter() does not need to return EAGAIN Dave Chinner
2022-05-06  9:45 ` [PATCH 13/17] xfs: introduce attr remove initial states into xfs_attr_set_iter Dave Chinner
2022-05-06  9:45 ` [PATCH 14/17] xfs: switch attr remove to xfs_attri_set_iter Dave Chinner
2022-05-06 23:44   ` Alli
2022-05-06  9:45 ` [PATCH 15/17] xfs: remove xfs_attri_remove_iter Dave Chinner
2022-05-06  9:45 ` [PATCH 16/17] xfs: use XFS_DA_OP flags in deferred attr ops Dave Chinner
2022-05-09  8:17   ` Dave Chinner
2022-05-10 22:31     ` Alli [this message]
2022-05-06  9:45 ` [PATCH 17/17] xfs: ATTR_REPLACE algorithm with LARP enabled needs rework Dave Chinner
2022-05-07  6:01   ` Alli
2022-05-08 21:50     ` Dave Chinner
2022-05-08 23:24       ` Dave Chinner
2022-05-06 22:35 ` [PATCH 00/17 V3] XFS: LARP state machine and recovery rework Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe70c43373e1658d72b728319a42c68c19b69451.camel@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox