From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
linux-xfs@vger.kernel.org, Dave Chinner <dchinner@redhat.com>
Subject: Re: XBF_DONE semantics
Date: Tue, 28 Nov 2023 18:13:01 +0100 [thread overview]
Message-ID: <20231128171301.GA27293@lst.de> (raw)
In-Reply-To: <20231128165831.GW2766956@frogsfrogsfrogs>
On Tue, Nov 28, 2023 at 08:58:31AM -0800, Darrick J. Wong wrote:
> > The way we currently set and check XBF_DONE seems a bit undefined. The
> > one clear use case is that read uses it to see if a buffer was read in.
> > But places that use buf_get and manually fill in data only use it in a
> > few cases. Do we need to define clear semantics for it? Or maybe
> > replace with an XBF_READ_DONE flag for that main read use case and
> > then think what do do with the rest?
>
> I thought XBF_DONE meant "contents have been read in from disk and
> have passed/will pass verifiers"
That's what I though too. But there's clearly code that treats it
differently..
> Dave and I wondered if xfs_inode_item_precommit should be grabbing the
> buffer at all when ISTALE is set, since xfs_ifree_cluster should have
> staled (and invalidated) the buffer after setting ISTALE.
That does sound reasonable.
> > +++ b/fs/xfs/xfs_trans_buf.c
> > @@ -253,7 +253,6 @@ xfs_trans_read_buf_map(
> > ASSERT(bp->b_transp == tp);
> > ASSERT(bp->b_log_item != NULL);
> > ASSERT(!bp->b_error);
> > - ASSERT(bp->b_flags & XBF_DONE);
>
> I don't think this is the right thing to do here -- if the buffer is
> attached to a transaction, it ought to be XBF_DONE. I think every
> transaction that calls _get_buf and rewrites the buffer contents will
> set XBF_DONE via xfs_trans_dirty_buf, right?
>
> Hmm. Maybe I'm wrong -- a transaction could bjoin a buffer and then
> call xfs_trans_read_buf_map before dirtying it. That strikes me as a
> suspicious thing to do, though.
I suspect it's happening here somehow. I can try to find some more
time pinning it down.
next prev parent reply other threads:[~2023-11-28 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 15:38 XBF_DONE semantics Christoph Hellwig
2023-11-28 16:58 ` Darrick J. Wong
2023-11-28 17:13 ` Christoph Hellwig [this message]
2023-11-28 22:42 ` Dave Chinner
2023-11-28 21:08 ` Dave Chinner
2023-11-29 6:18 ` Christoph Hellwig
2023-11-29 8:21 ` 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=20231128171301.GA27293@lst.de \
--to=hch@lst.de \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.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