Skip to contentSkip to conversation

xfs: set IOMAP_F_INTEGRITY for zoned writes on integrity devices

PATCH Applied Christoph Hellwig 3 participants 3 messages Sep 7 – Sep 11 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: set IOMAP_F_INTEGRITY for zoned writes on integrity devices

From: Anuj Gupta <[email protected]>

xfs_iomap_set_anon_write does not set IOMAP_F_INTEGRITY based on bdev_has_integrity_csum(), so file system PI generation is silently skipped for zoned writes on integrity-enabled devices, and left to the block layer PI generation.

Fixes 6bbb4d96f797 ("xfs: support T10 protection information")
[hch: ported to the recently introduced xfs_iomap_set_anon_write()]
---
 fs/xfs/xfs_iomap.h | 2 ++
 1 file changed, 2 insertions(+)
fs/xfs/xfs_iomap.h +2 -0
index c906c62d46f3..f2520a9b3a13 100644
@@ -41,6 +41,8 @@ xfs_iomap_set_anon_write(
 	iomap->offset = offset;
 	iomap->length = length;
 	iomap->flags = IOMAP_F_ANON_WRITE | IOMAP_F_DIRTY;
+	if (bdev_has_integrity_csum(iomap->bdev))
+		iomap->flags |= IOMAP_F_INTEGRITY;
 }
 
 static inline xfs_filblks_t
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Christoph Hellwig

From: Anuj Gupta <[email protected]>

xfs_iomap_set_anon_write does not set IOMAP_F_INTEGRITY based on bdev_has_integrity_csum(), so file system PI generation is silently skipped for zoned writes on integrity-enabled devices, and left to the block layer PI generation.

Fixes 6bbb4d96f797 ("xfs: support T10 protection information")
[hch: ported to the recently introduced xfs_iomap_set_anon_write()]

Looks good to me,

--D

Quoted 21 lines
---
 fs/xfs/xfs_iomap.h | 2 ++
 1 file changed, 2 insertions(+)
fs/xfs/xfs_iomap.h +2 -0
index c906c62d46f3..f2520a9b3a13 100644
@@ -41,6 +41,8 @@ xfs_iomap_set_anon_write(
 	iomap->offset = offset;
 	iomap->length = length;
 	iomap->flags = IOMAP_F_ANON_WRITE | IOMAP_F_DIRTY;
+	if (bdev_has_integrity_csum(iomap->bdev))
+		iomap->flags |= IOMAP_F_INTEGRITY;
 }
 
 static inline xfs_filblks_t
Signature · 1 line
2.53.0
maintainer Applied
#2 lore raw
In reply to Christoph Hellwig
Quoted 6 lines · Christoph Hellwig

xfs_iomap_set_anon_write does not set IOMAP_F_INTEGRITY based on bdev_has_integrity_csum(), so file system PI generation is silently skipped for zoned writes on integrity-enabled devices, and left to the block layer PI generation.

Applied to for-next, thanks!

[1/1] xfs: set IOMAP_F_INTEGRITY for zoned writes on integrity devices

      commit: 50ba24ccb9a94f61c707209442ca23d98c815052

Best regards,

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