Skip to content
Commit e461338b authored by Martin K. Petersen's avatar Martin K. Petersen Committed by Christoph Hellwig
Browse files

sd: tweak discard heuristics to work around QEMU SCSI issue

7985090a

 changed the discard heuristics to give preference to the
WRITE SAME commands that (unlike UNMAP) guarantee deterministic results.

Ming Lei discovered that QEMU SCSI's WRITE SAME implementation
internally relied on limits that were only communicated for the UNMAP
case. And therefore discard commands backed by WRITE SAME would fail.

Tweak the heuristics so we still pick UNMAP in the LBPRZ=0 case and only
prefer the WRITE SAME variants if the device has the LBPRZ flag set.

Reported-by: default avatarMing Lei <ming.lei@canonical.com>
Tested-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent b7392d22
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment