Message ID | 20240817005325.3319384-1-martin.petersen@oracle.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | scsi: sd: Do not attempt to configure discard unless LBPME is set | expand |
On Fri, 16 Aug 2024 20:53:10 -0400, Martin K. Petersen wrote: > Commit f874d7210d88 ("scsi: sd: Keep the discard mode stable") > attempted to address an issue where one mode of discard operation got > configured prior to the device completing full discovery. > Unfortunately this change assumed discard was always enabled on the > device. > > Do not attempt to configure discard unless LBPME is enabled. > > [...] Applied to 6.11/scsi-fixes, thanks! [1/1] scsi: sd: Do not attempt to configure discard unless LBPME is set https://git.kernel.org/mkp/scsi/c/cbaac68987b8
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 699f4f9674d9..dad3991397cf 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3308,6 +3308,9 @@ static void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer) static unsigned int sd_discard_mode(struct scsi_disk *sdkp) { + if (!sdkp->lbpme) + return SD_LBP_FULL; + if (!sdkp->lbpvpd) { /* LBP VPD page not provided */ if (sdkp->max_unmap_blocks)