Commit e0389e72 authored by Martin K. Petersen's avatar Martin K. Petersen Committed by sanglipeng
Browse files

block: bio-integrity: Copy flags when bio_integrity_payload is cloned

stable inclusion
from stable-v5.10.173
commit 0a82c1e0573b87bf32f96165a76d19e2ebd23c35
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8BFR3

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0a82c1e0573b87bf32f96165a76d19e2ebd23c35



--------------------------------

[ Upstream commit b6a4bdcd ]

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: aae7df50 ("block: Integrity checksum flag")
Fixes: b1f01388 ("block: Relocate bio integrity flags")
Reported-by: default avatarSaurav Kashyap <skashyap@marvell.com>
Tested-by: default avatarSaurav Kashyap <skashyap@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20230215171801.21062-1-martin.petersen@oracle.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent f6c1b4fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment