Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] xfs: fix IOMAP_F_DIRTY flag overwrite in zoned DIO
@ 2026-08-10 15:21 Andrey Albershteyn
  2026-08-10 15:23 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Albershteyn @ 2026-08-10 15:21 UTC (permalink / raw)
  To: linux-xfs; +Cc: Andrey Albershteyn, djwong, hch, cem

Missing IOMAP_F_DIRTY prevents completion handlers from updating i_size
on the direct IO path, the flag is set but was overwritten by
IOMAP_F_ANON_WRITE latter. The writeback path for buffered IO doesn't
seem to require IOMAP_F_DIRTY and looks like an error.

Fixes: 2e2383405824 ("xfs: implement direct writes to zoned RT devices")
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
 fs/xfs/xfs_aops.c  | 1 -
 fs/xfs/xfs_iomap.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 51293b6f331f..01a981bf126e 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -632,7 +632,6 @@ xfs_zoned_map_blocks(
 	xfs_iunlock(ip, XFS_ILOCK_EXCL);
 
 	wpc->iomap.type = IOMAP_MAPPED;
-	wpc->iomap.flags = IOMAP_F_DIRTY;
 	wpc->iomap.bdev = mp->m_rtdev_targp->bt_bdev;
 	wpc->iomap.offset = offset;
 	wpc->iomap.length = XFS_FSB_TO_B(mp, count_fsb);
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 225c3de88d03..45eef1b815b3 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1081,11 +1081,10 @@ xfs_zoned_direct_write_iomap_begin(
 	}
 
 	iomap->type = IOMAP_MAPPED;
-	iomap->flags = IOMAP_F_DIRTY;
 	iomap->bdev = ip->i_mount->m_rtdev_targp->bt_bdev;
 	iomap->offset = offset;
 	iomap->length = length;
-	iomap->flags = IOMAP_F_ANON_WRITE;
+	iomap->flags = IOMAP_F_DIRTY | IOMAP_F_ANON_WRITE;
 	return 0;
 }
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: fix IOMAP_F_DIRTY flag overwrite in zoned DIO
  2026-08-10 15:21 [PATCH] xfs: fix IOMAP_F_DIRTY flag overwrite in zoned DIO Andrey Albershteyn
@ 2026-08-10 15:23 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2026-08-10 15:23 UTC (permalink / raw)
  To: Andrey Albershteyn; +Cc: linux-xfs, djwong, hch, cem

On Mon, Aug 10, 2026 at 05:21:31PM +0200, Andrey Albershteyn wrote:
> Missing IOMAP_F_DIRTY prevents completion handlers from updating i_size
> on the direct IO path, the flag is set but was overwritten by
> IOMAP_F_ANON_WRITE latter. The writeback path for buffered IO doesn't
> seem to require IOMAP_F_DIRTY and looks like an error.
> 
> Fixes: 2e2383405824 ("xfs: implement direct writes to zoned RT devices")
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>

I actually have exactly the same fix in a series I'm about to send
out, and a cleanup to move this into common code.

I guess we both saw the same Sashiko comment :)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-10 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 15:21 [PATCH] xfs: fix IOMAP_F_DIRTY flag overwrite in zoned DIO Andrey Albershteyn
2026-08-10 15:23 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox