block: define set of integrity flags to be inherited by cloned bip
authorAnuj Gupta <anuj20.g@samsung.com>
Thu, 28 Nov 2024 11:22:31 +0000 (16:52 +0530)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Dec 2024 15:17:16 +0000 (08:17 -0700)
Introduce BIP_CLONE_FLAGS describing integrity flags that should be
inherited in the cloned bip from the parent.

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20241128112240.8867-2-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio-integrity.c
include/linux/bio-integrity.h

index 2a4bd661169207d5ba909ac03d573b508a529c16..a448a25d13dee177075d821f9875abc1a7f2384d 100644 (file)
@@ -559,7 +559,7 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
 
        bip->bip_vec = bip_src->bip_vec;
        bip->bip_iter = bip_src->bip_iter;
-       bip->bip_flags = bip_src->bip_flags & ~BIP_BLOCK_INTEGRITY;
+       bip->bip_flags = bip_src->bip_flags & BIP_CLONE_FLAGS;
 
        return 0;
 }
index dbf0f74c15291327c11af3c393386ec13cc3906f..0f0cf10222e89cb947b76eeaaf794795f05e3411 100644 (file)
@@ -30,6 +30,9 @@ struct bio_integrity_payload {
        struct bio_vec          bip_inline_vecs[];/* embedded bvec array */
 };
 
+#define BIP_CLONE_FLAGS (BIP_MAPPED_INTEGRITY | BIP_CTRL_NOCHECK | \
+                        BIP_DISK_NOCHECK | BIP_IP_CHECKSUM)
+
 #ifdef CONFIG_BLK_DEV_INTEGRITY
 
 #define bip_for_each_vec(bvl, bip, iter)                               \