]> www.infradead.org Git - users/hch/block.git/commitdiff
block: also verify PI when not submitted by the block layer
authorChristoph Hellwig <hch@lst.de>
Sun, 6 Jun 2021 12:12:05 +0000 (14:12 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 9 Jun 2022 07:06:38 +0000 (09:06 +0200)
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 <hch@lst.de>
block/bio-integrity.c

index 84ea859c489109b505018ce5cbc07c58f1af93a0..c3ae0abd556132b4e8ecf11fa6f92c3a0e3e1be1 100644 (file)
@@ -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;