diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2023-02-15 20:18:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-11 18:43:35 +0300 |
commit | 82d68c32449766e360faa55d1b3c7f4e9da401fc (patch) | |
tree | 6a0ac331f1e97e1aa4dc158737cee94f2b015e10 /block | |
parent | 084cd75643b61fb924f70cba98a71dea14942938 (diff) | |
download | linux-82d68c32449766e360faa55d1b3c7f4e9da401fc.tar.xz |
block: bio-integrity: Copy flags when bio_integrity_payload is cloned
[ Upstream commit b6a4bdcda430e3ca43bbb9cb1d4d4d34ebe15c40 ]
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: aae7df50190a ("block: Integrity checksum flag")
Fixes: b1f01388574c ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block')
-rw-r--r-- | block/bio-integrity.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c index ec295be93ca0..247f7c480e66 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -424,6 +424,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; } |