Skip to content

Commit b6a4bdc

Browse files
martinkpetersenaxboe
authored andcommitted
block: bio-integrity: Copy flags when bio_integrity_payload is cloned
Make sure to copy the flags when a bio_integrity_payload is cloned. Otherwise per-I/O properties such as IP checksum flag will not be passed down to the HBA driver. Since the integrity buffer is owned by the original bio, the BIP_BLOCK_INTEGRITY flag needs to be masked off to avoid a double free in the completion path. Fixes: aae7df5 ("block: Integrity checksum flag") Fixes: b1f0138 ("block: Relocate bio integrity flags") Reported-by: Saurav Kashyap <[email protected]> Tested-by: Saurav Kashyap <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 0f7c8f0 commit b6a4bdc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/bio-integrity.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
413413

414414
bip->bip_vcnt = bip_src->bip_vcnt;
415415
bip->bip_iter = bip_src->bip_iter;
416+
bip->bip_flags = bip_src->bip_flags & ~BIP_BLOCK_INTEGRITY;
416417

417418
return 0;
418419
}

0 commit comments

Comments
 (0)