From 460cb6d3b26fb501fcfe77e2fbff1b4af147a469 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 6 Jun 2021 14:12:05 +0200 Subject: [PATCH] block: also verify PI when not submitted by the block layer Currently __bio_integrity_endio skips bios not marked with BIP_BLOCK_INTEGRITY. This means bios submitted by the SCSI and nvme target drivers never verify the protection information. Fix that by removing the check for this flag. Signed-off-by: Christoph Hellwig --- block/bio-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 84ea859c4891..c3ae0abd5561 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -346,7 +346,7 @@ bool __bio_integrity_endio(struct bio *bio) struct bio_integrity_payload *bip = bio_integrity(bio); if (bio_op(bio) == REQ_OP_READ && !bio->bi_status && - (bip->bip_flags & BIP_BLOCK_INTEGRITY) && bi->profile->verify_fn) { + bi->profile->verify_fn) { INIT_WORK(&bip->bip_work, bio_integrity_verify_fn); queue_work(kintegrityd_wq, &bip->bip_work); return false; -- 2.50.1