mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 05:11:48 +00:00
sd: Fix discard granularity when LBPRZ=1
Commit397737223c
("sd: Make discard granularity match logical block size when LBPRZ=1") accidentally set the granularity to one byte instead of one logical block on devices that provide deterministic zeroes after UNMAP. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Reported-by: Mike Snitzer <snitzer@redhat.com> Reviewed-by: Ewan Milne <emilne@redhat.com> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Fixes:397737223c
Cc: <stable@vger.kernel.org> #v4.4+
This commit is contained in:
parent
688875826f
commit
f4327a95dd
@ -648,7 +648,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
|
||||
*/
|
||||
if (sdkp->lbprz) {
|
||||
q->limits.discard_alignment = 0;
|
||||
q->limits.discard_granularity = 1;
|
||||
q->limits.discard_granularity = logical_block_size;
|
||||
} else {
|
||||
q->limits.discard_alignment = sdkp->unmap_alignment *
|
||||
logical_block_size;
|
||||
|
Loading…
Reference in New Issue
Block a user