From: Martin K. Petersen Date: Mon, 13 Feb 2012 20:39:00 +0000 (-0500) Subject: [SCSI] sd: Make sure provisioning mode is reported correctly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=89730393f260aef7fce9f6fd475da148517a4c5c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [SCSI] sd: Make sure provisioning mode is reported correctly 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 Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c691fb50e6cb..8c525aa1b858 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -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; } /**