public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH] xfs: recheck appropriateness of map_shared lock
Date: Mon, 10 Apr 2023 18:05:31 -0700	[thread overview]
Message-ID: <20230411010531.GE360889@frogsfrogsfrogs> (raw)
In-Reply-To: <Y8mMailEevUSZkG+@infradead.org>

On Thu, Jan 19, 2023 at 10:31:06AM -0800, Christoph Hellwig wrote:
> On Wed, Jan 18, 2023 at 05:24:58PM -0800, Darrick J. Wong wrote:
> >  	xfs_ilock(ip, lock_mode);
> > +
> > +	/*
> > +	 * It's possible that the unlocked access of the data fork to determine
> > +	 * the lock mode could have raced with another thread that was failing
> > +	 * to load the bmbt but hadn't yet torn down the iext tree.  Recheck
> > +	 * the lock mode and upgrade to an exclusive lock if we need to.
> > +	 */
> > +	if (lock_mode == XFS_ILOCK_SHARED &&
> > +	    xfs_need_iread_extents(&ip->i_df)) {
> 
> Eww.  I think the proper fix here is to make sure
> xfs_need_iread_extents does not return false until we're actually
> read the extents.  So I think we'll need a new inode flag
> XFS_INEED_READ - gets set when reading inode in btree format,
> and gets cleared at the very end of xfs_iread_extents once we know
> the read succeeded.

So I finally cleared enough off my plate to get back to this, and
reworking the patch this way *looks* promising.  It definitely fixes the
xfs/375 problems, and over the weekend I didn't see any obvious splats.

--D

      reply	other threads:[~2023-04-11  1:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  1:24 [PATCH] xfs: recheck appropriateness of map_shared lock Darrick J. Wong
2023-01-19  5:14 ` Dave Chinner
2023-01-19 18:39   ` Christoph Hellwig
2023-01-19 20:34     ` Dave Chinner
2023-02-28 20:08   ` Darrick J. Wong
2023-01-19 18:31 ` Christoph Hellwig
2023-04-11  1:05   ` 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=20230411010531.GE360889@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --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