Skip to contentSkip to conversation

xfs: initialize iomap->flags earlier in xfs_bmbt_to_iomap

PATCH Applied Christoph Hellwig 3 participants 3 messages Jun 9 – Jun 10 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: initialize iomap->flags earlier in xfs_bmbt_to_iomap

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")
---
 fs/xfs/xfs_iomap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_iomap.c +1 -1
index f20a02f49ed9..1403d568a442 100644
@@ -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 {
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Christoph Hellwig

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")

Makes sense to me;

--D

Quoted 27 lines
---
 fs/xfs/xfs_iomap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_iomap.c +1 -1
index f20a02f49ed9..1403d568a442 100644
@@ -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 {
Signature · 1 line
2.53.0
maintainer Applied
#2 lore raw
In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

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.

Applied to for-next, thanks!

[1/1] xfs: initialize iomap->flags earlier in xfs_bmbt_to_iomap

      commit: 327e58826eb72f8bae9419cf1a4e722b57c85694

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>