From 89730393f260aef7fce9f6fd475da148517a4c5c Mon Sep 17 00:00:00 2001 From: "Martin K. Petersen" Date: Mon, 13 Feb 2012 15:39:00 -0500 Subject: [PATCH] [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 --- drivers/scsi/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } /**