* [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
@ 2026-01-13 15:39 Christoph Hellwig
2026-01-13 15:48 ` Darrick J. Wong
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Christoph Hellwig @ 2026-01-13 15:39 UTC (permalink / raw)
To: brauner, djwong; +Cc: bfoster, linux-xfs, linux-fsdevel
__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);
return folio;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
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
2026-01-13 15:58 ` Christoph Hellwig
2026-01-13 15:50 ` Brian Foster
2026-01-14 16:06 ` Christian Brauner
2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2026-01-13 15:48 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: brauner, bfoster, linux-xfs, linux-fsdevel
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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
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
@ 2026-01-13 15:50 ` Brian Foster
2026-01-14 16:06 ` Christian Brauner
2 siblings, 0 replies; 7+ messages in thread
From: Brian Foster @ 2026-01-13 15:50 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: brauner, djwong, linux-xfs, linux-fsdevel
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>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> 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);
> return folio;
> }
>
> --
> 2.47.3
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
2026-01-13 15:48 ` Darrick J. Wong
@ 2026-01-13 15:58 ` Christoph Hellwig
2026-01-13 16:12 ` Brian Foster
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2026-01-13 15:58 UTC (permalink / raw)
To: Darrick J. Wong
Cc: Christoph Hellwig, brauner, bfoster, linux-xfs, linux-fsdevel
On Tue, Jan 13, 2026 at 07:48:55AM -0800, Darrick J. Wong wrote:
> 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.
Let's wait until we have another user or two. Premature refactoring
tends to backfire.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
2026-01-13 15:58 ` Christoph Hellwig
@ 2026-01-13 16:12 ` Brian Foster
2026-01-13 18:08 ` Darrick J. Wong
0 siblings, 1 reply; 7+ messages in thread
From: Brian Foster @ 2026-01-13 16:12 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Darrick J. Wong, brauner, linux-xfs, linux-fsdevel
On Tue, Jan 13, 2026 at 04:58:05PM +0100, Christoph Hellwig wrote:
> On Tue, Jan 13, 2026 at 07:48:55AM -0800, Darrick J. Wong wrote:
> > 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.
>
> Let's wait until we have another user or two. Premature refactoring
> tends to backfire.
>
I agree on not being too aggressive on that... I do like the idea
though, so I'll try to keep it in mind if this happens to expand down
the road. Thanks for the fix.
Brian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
2026-01-13 16:12 ` Brian Foster
@ 2026-01-13 18:08 ` Darrick J. Wong
0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2026-01-13 18:08 UTC (permalink / raw)
To: Brian Foster; +Cc: Christoph Hellwig, brauner, linux-xfs, linux-fsdevel
On Tue, Jan 13, 2026 at 11:12:01AM -0500, Brian Foster wrote:
> On Tue, Jan 13, 2026 at 04:58:05PM +0100, Christoph Hellwig wrote:
> > On Tue, Jan 13, 2026 at 07:48:55AM -0800, Darrick J. Wong wrote:
> > > 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.
> >
> > Let's wait until we have another user or two. Premature refactoring
> > tends to backfire.
> >
>
> I agree on not being too aggressive on that... I do like the idea
> though, so I'll try to keep it in mind if this happens to expand down
> the road. Thanks for the fix.
<nod> Making the second user do the refactoring is ok with me. :)
--D
> Brian
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iomap: wait for batched folios to be stable in __iomap_get_folio
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
2026-01-13 15:50 ` Brian Foster
@ 2026-01-14 16:06 ` Christian Brauner
2 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2026-01-14 16:06 UTC (permalink / raw)
To: djwong, Christoph Hellwig
Cc: Christian Brauner, bfoster, linux-xfs, linux-fsdevel
On Tue, 13 Jan 2026 16:39:17 +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.
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] iomap: wait for batched folios to be stable in __iomap_get_folio
https://git.kernel.org/vfs/vfs/c/561940a7ee81
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-14 16:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox