From: Martin K. Petersen Date: Tue, 6 Nov 2018 02:44:51 +0000 (-0500) Subject: oracleasm: Honor ASM_IFLAG_FORMAT_NOCHECK flag X-Git-Tag: v4.1.12-124.31.3~421 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8bf5286f37eca5f7ed02c3f0d9901a1eb4e3a1b3;p=users%2Fjedix%2Flinux-maple.git oracleasm: Honor ASM_IFLAG_FORMAT_NOCHECK flag If ASMLib supports the QUERY HANDLE operation, it will set the ASM_IFLAG_FORMAT_NOCHECK flag on the ioc. This signals to the kernel driver that the integrity information does not depend on the contents of the it_format field and the ASM disk handle. Orabug: 28650922 Reviewed-by: Sajid Zia Signed-off-by: Martin K. Petersen Signed-off-by: Rajan Shanmugavelu Signed-off-by: Brian Maly --- diff --git a/drivers/block/oracleasm/integrity.c b/drivers/block/oracleasm/integrity.c index ed5adaa4442fa..228e4ef1d657f 100644 --- a/drivers/block/oracleasm/integrity.c +++ b/drivers/block/oracleasm/integrity.c @@ -85,23 +85,11 @@ int asm_integrity_check(struct oracleasm_integrity_v2 *it, struct block_device * { unsigned int dev_format; - /* Strip feature flags */ - dev_format = asm_integrity_format(bdev) & ASM_INTEGRITY_HANDLE_MASK; - - if (!dev_format) - return 0; - if (unlikely(it->it_magic != ASM_INTEGRITY_MAGIC)) { pr_err("%s: Bad integrity magic %x!\n", __func__, it->it_magic); return -EINVAL; } - if (unlikely(it->it_format != dev_format)) { - pr_err("%s: incorrect format for %s (%u != %u)\n", __func__, - bdev->bd_disk->disk_name, it->it_format, dev_format); - return -EINVAL; - } - if (unlikely(it->it_bytes == 0)) { pr_err("%s: zero length integrity buffer\n", __func__); return -EINVAL; @@ -112,6 +100,20 @@ int asm_integrity_check(struct oracleasm_integrity_v2 *it, struct block_device * return -EINVAL; } + if (it->it_flags & ASM_IFLAG_FORMAT_NOCHECK) + return 0; + + dev_format = asm_integrity_format(bdev) & ASM_INTEGRITY_HANDLE_MASK; + + if (!dev_format) + return -EINVAL; + + if (unlikely(it->it_format != dev_format)) { + pr_err("%s: incorrect format for %s (%u != %u)\n", __func__, + bdev->bd_disk->disk_name, it->it_format, dev_format); + return -EINVAL; + } + return 0; } /* asm_integrity_check */ diff --git a/include/linux/oracleasm/abi.h b/include/linux/oracleasm/abi.h index c0ac30bfca44e..7884f98a1a1e9 100644 --- a/include/linux/oracleasm/abi.h +++ b/include/linux/oracleasm/abi.h @@ -165,6 +165,7 @@ enum oracleasm_integrity_handling_flags { ASM_IFLAG_IP_CHECKSUM = 2, /* IP checksum instead of CRC */ ASM_IFLAG_CTRL_NOCHECK = 4, /* Disable HBA PI checks */ ASM_IFLAG_DISK_NOCHECK = 8, /* Disable disk PI checks */ + ASM_IFLAG_FORMAT_NOCHECK = 16, /* Disable IT format check */ }; struct oracleasm_query_disk_v2