Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89730393 authored by Martin K. Petersen's avatar Martin K. Petersen Committed by James Bottomley
Browse files

[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: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 66a651aa
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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;
}
}


/**
/**