From: Martin K. Petersen Date: Wed, 8 Aug 2018 11:49:27 +0000 (-0400) Subject: oracleasm: Don't assume bip was allocated by oracleasm X-Git-Tag: v4.1.12-124.31.3~584 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=95a56c4e00e1a436fb362f5eafab3ad0f7fede08;p=users%2Fjedix%2Flinux-maple.git oracleasm: Don't assume bip was allocated by oracleasm 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 Signed-off-by: Brian Maly --- diff --git a/drivers/block/oracleasm/integrity.c b/drivers/block/oracleasm/integrity.c index 61263f79869f..96ce08c72292 100644 --- a/drivers/block/oracleasm/integrity.c +++ b/drivers/block/oracleasm/integrity.c @@ -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);