Skip to content

Commit

Permalink
[SCSI] sd: Make sure provisioning mode is reported correctly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
martinkpetersen authored and James Bottomley committed Feb 19, 2012
1 parent 66a651a commit 8973039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 8973039

Please sign in to comment.