]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
oracleasm: Restrict logical block size reporting
authorMartin K. Petersen <martin.petersen@oracle.com>
Thu, 24 Apr 2014 19:36:42 +0000 (15:36 -0400)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Mon, 29 Jun 2015 15:34:53 +0000 (08:34 -0700)
Hanlin pointed out that we should only report the additional logical
block size when we are in physical block size mode. When the
"use_logical_block_size" module parameter is in use we should revert to
the old behavior.

Reported-by: Hanlin Chien <hanlin.qian@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/block/oracleasm/driver.c

index 5de7c4a193e38b257b0383e010cc802bcfaeb123..f56799333ca7d691b82914332010e3dbdf30b92b 100644 (file)
@@ -2344,7 +2344,7 @@ static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size)
        struct oracleasm_query_disk_v2 *qd_info;
        struct file *filp;
        struct block_device *bdev;
-       unsigned int lsecsz;
+       unsigned int lsecsz = 0;
        int ret;
 
        mlog_entry("(0x%p, 0x%p, %u)\n", file, buf, (unsigned int)size);
@@ -2379,12 +2379,16 @@ static ssize_t asmfs_svc_query_disk(struct file *file, char *buf, size_t size)
 
        bdev = I_BDEV(filp->f_mapping->host);
 
-       lsecsz = ilog2(bdev_logical_block_size(bdev));
        qd_info->qd_max_sectors = compute_max_sectors(bdev);
        qd_info->qd_hardsect_size = asm_block_size(bdev);
        qd_info->qd_feature = asm_integrity_format(bdev) &
                ASM_INTEGRITY_QDF_MASK;
-       qd_info->qd_feature |=  lsecsz << ASM_LSECSZ_SHIFT & ASM_LSECSZ_MASK;
+       if (use_logical_block_size == false) {
+               lsecsz = ilog2(bdev_logical_block_size(bdev));
+               qd_info->qd_feature |= lsecsz << ASM_LSECSZ_SHIFT
+                       & ASM_LSECSZ_MASK;
+       }
+
        mlog(ML_ABI|ML_DISK,
             "Querydisk returning qd_max_sectors = %u and "
             "qd_hardsect_size = %u, lsecsz = %u, qd_integrity = %u\n",