public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Brian Foster <bfoster@redhat.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: use bitops interface for buf log item AIL flag check
Date: Tue, 17 Dec 2019 13:51:43 -0800	[thread overview]
Message-ID: <20191217215143.GD12765@magnolia> (raw)
In-Reply-To: <b6375ec4-f2e4-0e87-376c-ff25ee83a563@sandeen.net>

On Tue, Dec 17, 2019 at 02:01:26PM -0600, Eric Sandeen wrote:
> On 12/17/19 12:42 PM, Brian Foster wrote:
> > The xfs_log_item flags were converted to atomic bitops as of commit
> > 22525c17ed ("xfs: log item flags are racy"). The assert check for
> > AIL presence in xfs_buf_item_relse() still uses the old value based
> > check. This likely went unnoticed as XFS_LI_IN_AIL evaluates to 0
> > and causes the assert to unconditionally pass. Fix up the check.
> > 
> > Signed-off-by: Brian Foster <bfoster@redhat.com>
> 
> Whoops.
> 
> Fixes: 22525c17ed ("xfs: log item flags are racy")
> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> 

Looks ok to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> > ---
> >  fs/xfs/xfs_buf_item.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> > index 3458a1264a3f..3984779e5911 100644
> > --- a/fs/xfs/xfs_buf_item.c
> > +++ b/fs/xfs/xfs_buf_item.c
> > @@ -956,7 +956,7 @@ xfs_buf_item_relse(
> >  	struct xfs_buf_log_item	*bip = bp->b_log_item;
> >  
> >  	trace_xfs_buf_item_relse(bp, _RET_IP_);
> > -	ASSERT(!(bip->bli_item.li_flags & XFS_LI_IN_AIL));
> > +	ASSERT(!test_bit(XFS_LI_IN_AIL, &bip->bli_item.li_flags));
> >  
> >  	bp->b_log_item = NULL;
> >  	if (list_empty(&bp->b_li_list))
> > 

      reply	other threads:[~2019-12-17 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 18:42 [PATCH] xfs: use bitops interface for buf log item AIL flag check Brian Foster
2019-12-17 20:01 ` Eric Sandeen
2019-12-17 21:51   ` Darrick J. Wong [this message]

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=20191217215143.GD12765@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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