[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>
This commit is contained in:
Martin K. Petersen 2012-02-13 15:39:00 -05:00 коммит произвёл James Bottomley
Родитель 66a651aa7a
Коммит 89730393f2
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -497,6 +497,8 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
max(sdkp->physical_block_size, max(sdkp->physical_block_size,
sdkp->unmap_granularity * logical_block_size); sdkp->unmap_granularity * logical_block_size);
sdkp->provisioning_mode = mode;
switch (mode) { switch (mode) {
case SD_LBP_DISABLE: 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); q->limits.max_discard_sectors = max_blocks * (logical_block_size >> 9);
queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
sdkp->provisioning_mode = mode;
} }
/** /**