Skip to content

Commit f3ee506

Browse files
Anuj Guptabrauner
authored andcommitted
nvme: set pi_offset only when checksum type is not BLK_INTEGRITY_CSUM_NONE
protection information is treated as opaque when checksum type is BLK_INTEGRITY_CSUM_NONE. In order to maintain the right metadata semantics, set pi_offset only in cases where checksum type is not BLK_INTEGRITY_CSUM_NONE. Signed-off-by: Anuj Gupta <anuj20.g@samsung.com> Link: https://lore.kernel.org/20250630090548.3317-4-anuj20.g@samsung.com Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 76e4525 commit f3ee506

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,9 +1867,10 @@ static bool nvme_init_integrity(struct nvme_ns_head *head,
18671867
}
18681868

18691869
bi->metadata_size = head->ms;
1870-
if (bi->csum_type)
1870+
if (bi->csum_type) {
18711871
bi->pi_tuple_size = head->pi_size;
1872-
bi->pi_offset = info->pi_offset;
1872+
bi->pi_offset = info->pi_offset;
1873+
}
18731874
return true;
18741875
}
18751876

0 commit comments

Comments
 (0)