linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Sachin Sant <sachinp@linux.ibm.com>,
	linux-xfs@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	riteshh@linux.ibm.com, linux-next@vger.kernel.org,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [next-20220215] WARNING at fs/iomap/buffered-io.c:75 with xfstests
Date: Wed, 16 Feb 2022 17:46:07 +0000	[thread overview]
Message-ID: <Yg04X73lr5YK5kwH@casper.infradead.org> (raw)
In-Reply-To: <20220216173504.GM8313@magnolia>

On Wed, Feb 16, 2022 at 09:35:04AM -0800, Darrick J. Wong wrote:
> On Wed, Feb 16, 2022 at 12:55:02PM +0530, Sachin Sant wrote:
> > [ 2547.662818] ------------[ cut here ]------------
> > [ 2547.662832] WARNING: CPU: 24 PID: 2463718 at fs/iomap/buffered-io.c:75 iomap_page_release+0x1b0/0x1e0
> 
> ...and I think this is complaining about this debugging test in
> iomap_page_release:
> 
> 	WARN_ON_ONCE(bitmap_full(iop->uptodate, nr_blocks) !=
> 			folio_test_uptodate(folio));
> 
> which checks that we're not releasing or invalidating a page that's
> partially uptodate on a blocksize < pagesize filesystem (or so I gather
> from "POWER10 LPAR" (64k pages?) and "XFS" (4k blocks?))...

This happens _all_ _the_ _time_ in my testing.  If your block size is
less than page size, you can expect it.

What it's supposed to be testing is that we remembered to set the
uptodate flag once all blocks in this page are uptodate.  What's
tripping the check is iomap_writepage_map()'s stupid clearing of the
uptodate flag on the folio:

        if (unlikely(error)) {
...
                if (!count) {
                        folio_clear_uptodate(folio);
                        folio_unlock(folio);
                        goto done;

What particularly annoys me about this is that the folio _was_ uptodate,
and it was dirty, so it has newer data in it than is on disk, but we're
going to re-read the folio from disk and throw away that user data.

> Given that in this case we've already cleared SB_ACTIVE from the
> superblock s_flags, I wonder if we could amend that code to read:
> 
> 	if (inode->i_sb->s_flags & SB_ACTIVE)
> 		WARN_ON_ONCE(bitmap_full(iop->uptodate, nr_blocks) !=
> 				folio_test_uptodate(folio));
> 
> Since we don't really care about memory pages that aren't fully up to
> date if we're in the midst of freeing all the incore filesystem state.
> 
> Thoughts?

Seems like papering over a bad design decision to me.

      reply	other threads:[~2022-02-16 17:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5AD0BD6A-2C31-450A-924E-A581CD454073@linux.ibm.com>
2022-02-16 17:35 ` [next-20220215] WARNING at fs/iomap/buffered-io.c:75 with xfstests Darrick J. Wong
2022-02-16 17:46   ` Matthew Wilcox [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=Yg04X73lr5YK5kwH@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=djwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=riteshh@linux.ibm.com \
    --cc=sachinp@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).