diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2014-11-07 06:08:13 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 11:19:14 +0100 |
commit | 7985090aa0201fa7760583f9f8e6ba41a8d4c392 (patch) | |
tree | bb1c70e1cd918f56068482fcc8fca298e1c7cbda /fs/kernfs | |
parent | scsi: return EAGAIN when resetting a device under EH (diff) | |
download | linux-7985090aa0201fa7760583f9f8e6ba41a8d4c392.tar.xz linux-7985090aa0201fa7760583f9f8e6ba41a8d4c392.zip |
sd: disable discard_zeroes_data for UNMAP
The T10 SBC UNMAP command does not provide any hard guarantees that
blocks will return zeroes on a subsequent READ. This is due to the fact
that the device server is free to silently ignore all or parts of the
request.
The only way to ensure that a block consistently returns zeroes after
being unmapped is to use WRITE SAME with the UNMAP bit set. Should the
device be unable to unmap one or more blocks described by the command it
is required to manually write zeroes to them.
Until now we have preferred UNMAP over the WRITE SAME variants to
accommodate thinly provisioned devices that predated the final SBC-3
spec. This patch changes the heuristic so that we favor WRITE SAME(16)
or (10) over UNMAP if these commands are marked as supported in the
Logical Block Provisioning VPD page.
The patch also disables discard_zeroes_data for devices operating in
UNMAP mode.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/kernfs')
0 files changed, 0 insertions, 0 deletions