]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
oracleasm: Don't assume bip was allocated by oracleasm
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 8 Aug 2018 11:49:27 +0000 (07:49 -0400)
committerBrian Maly <brian.maly@oracle.com>
Wed, 15 Aug 2018 19:54:29 +0000 (15:54 -0400)
Orabug: 28506080

If a user runs an old ASMLIB without integrity support, the bip
attached to a bio is owned by the block layer. We should not attempt
to unmap the pages in question.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/block/oracleasm/integrity.c

index 61263f79869f2be92e0c9777ecf4177d767f6a7d..96ce08c72292a3350ef42cb7f34079f892481ba2 100644 (file)
@@ -220,6 +220,13 @@ void asm_integrity_unmap(struct bio *bio)
        if (!bip)
                return;
 
+       /*
+        * We may end up here if the user is running an old ASMLIB
+        * without integrity support.
+        */
+       if (bip->bip_flags & BIP_BLOCK_INTEGRITY)
+               return;
+
        bip_for_each_vec(iv, bio_integrity(bio), iter) {
                if (bio_data_dir(bio) == READ)
                        set_page_dirty_lock(iv.bv_page);