Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: brauner@kernel.org, bfoster@redhat.com,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
Date: Tue, 13 Jan 2026 07:48:55 -0800	[thread overview]
Message-ID: <20260113154855.GH15583@frogsfrogsfrogs> (raw)
In-Reply-To: <20260113153943.3323869-1-hch@lst.de>

On Tue, Jan 13, 2026 at 04:39:17PM +0100, Christoph Hellwig wrote:
> __iomap_get_folio needs to wait for writeback to finish if the file
> requires folios to be stable for writes.  For the regular path this is
> taken care of by __filemap_get_folio, but for the newly added batch
> lookup it has to be done manually.
> 
> This fixes xfs/131 failures when running on PI-capable hardware.
> 
> Fixes: 395ed1ef0012 ("iomap: optional zero range dirty folio processing")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/iomap/buffered-io.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index fd9a2cf95620..6beb876658c0 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -851,6 +851,7 @@ static struct folio *__iomap_get_folio(struct iomap_iter *iter,
>  		}
>  
>  		folio_get(folio);
> +		folio_wait_stable(folio);

Heh, oops.  That's a little too easy to miss. :(

I wonder if we ought to have a filemap_fbatch_next() that would take
care of the relocking, revalidation, and stabilization... but this spot
fix is good as-is.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

>  		return folio;
>  	}
>  
> -- 
> 2.47.3
> 

  reply	other threads:[~2026-01-13 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 15:39 [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio Christoph Hellwig
2026-01-13 15:48 ` Darrick J. Wong [this message]
2026-01-13 15:58   ` Christoph Hellwig
2026-01-13 16:12     ` Brian Foster
2026-01-13 18:08       ` Darrick J. Wong
2026-01-13 15:50 ` Brian Foster
2026-01-14 16:06 ` Christian Brauner

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=20260113154855.GH15583@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=bfoster@redhat.com \
    --cc=brauner@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.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