]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: initialize iomap->flags earlier in xfs_bmbt_to_iomap
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Jun 2026 07:53:44 +0000 (09:53 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 10 Jun 2026 10:21:52 +0000 (12:21 +0200)
Otherwise we lose the IOMAP_IOEND_BOUNDARY assingment for writes to the
first block in a realtime group, and could cause incorrect merges for
such writes.

Fixes: b91afef72471 ("xfs: don't merge ioends across RTGs")
Cc: <stable@vger.kernel.org> # v6.13
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_iomap.c

index 6ff722f04f5d5e3d0d54d560085215279d834b0e..225c3de88d03b17f66dd7742af6d900fc7c092d0 100644 (file)
@@ -113,6 +113,7 @@ xfs_bmbt_to_iomap(
                return xfs_alert_fsblock_zero(ip, imap);
        }
 
+       iomap->flags = iomap_flags;
        if (imap->br_startblock == HOLESTARTBLOCK) {
                iomap->addr = IOMAP_NULL_ADDR;
                iomap->type = IOMAP_HOLE;
@@ -143,7 +144,6 @@ xfs_bmbt_to_iomap(
        }
        iomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff);
        iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount);
-       iomap->flags = iomap_flags;
        if (mapping_flags & IOMAP_DAX) {
                iomap->dax_dev = target->bt_daxdev;
        } else {