[SCSI] sd: Make sure provisioning mode is reported correctly
authorMartin K. Petersen <martin.petersen@oracle.com>
Mon, 13 Feb 2012 20:39:00 +0000 (15:39 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Sun, 19 Feb 2012 15:39:09 +0000 (09:39 -0600)
The provisioning_mode parameter in sysfs did not get updated in the
SD_LBP_DISABLE case. Make sure the provisioning mode is always set
correctly.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/sd.c

index c691fb50e6cbfe75deceddcdf744dc1301cc7d08..8c525aa1b8582a40c00687238811e743bc527d55 100644 (file)
@@ -497,6 +497,8 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
                max(sdkp->physical_block_size,
                    sdkp->unmap_granularity * logical_block_size);
 
+       sdkp->provisioning_mode = mode;
+
        switch (mode) {
 
        case SD_LBP_DISABLE:
@@ -524,8 +526,6 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
 
        q->limits.max_discard_sectors = max_blocks * (logical_block_size >> 9);
        queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
-
-       sdkp->provisioning_mode = mode;
 }
 
 /**