Skip to content

Commit

Permalink
block: bio-integrity: Copy flags when bio_integrity_payload is cloned
Browse files Browse the repository at this point in the history
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 <skashyap@marvell.com>
Tested-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20230215171801.21062-1-martin.petersen@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Martin K. Petersen authored and Jens Axboe committed Feb 16, 2023
1 parent 0f7c8f0 commit b6a4bdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/bio-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src,

bip->bip_vcnt = bip_src->bip_vcnt;
bip->bip_iter = bip_src->bip_iter;
bip->bip_flags = bip_src->bip_flags & ~BIP_BLOCK_INTEGRITY;

return 0;
}
Expand Down

0 comments on commit b6a4bdc

Please sign in to comment.