diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2012-02-13 15:39:00 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 10:39:09 -0500 |
commit | 89730393f260aef7fce9f6fd475da148517a4c5c (patch) | |
tree | f01e8f64dfd43dc38c27f4f1d8be45ed2f43346d /drivers | |
parent | 66a651aa7a48b7c6181aff556937454c87bb9feb (diff) |
[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 <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/sd.c | 4 |
1 files 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) | |||
497 | max(sdkp->physical_block_size, | 497 | max(sdkp->physical_block_size, |
498 | sdkp->unmap_granularity * logical_block_size); | 498 | sdkp->unmap_granularity * logical_block_size); |
499 | 499 | ||
500 | sdkp->provisioning_mode = mode; | ||
501 | |||
500 | switch (mode) { | 502 | switch (mode) { |
501 | 503 | ||
502 | case SD_LBP_DISABLE: | 504 | case SD_LBP_DISABLE: |
@@ -524,8 +526,6 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode) | |||
524 | 526 | ||
525 | q->limits.max_discard_sectors = max_blocks * (logical_block_size >> 9); | 527 | q->limits.max_discard_sectors = max_blocks * (logical_block_size >> 9); |
526 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); | 528 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); |
527 | |||
528 | sdkp->provisioning_mode = mode; | ||
529 | } | 529 | } |
530 | 530 | ||
531 | /** | 531 | /** |