diff options
author | Christoph Hellwig <hch@lst.de> | 2019-03-13 20:55:05 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-03-13 21:57:34 +0300 |
commit | 7b210e4ed5e281728243799c5e2b84d3f70d4dd1 (patch) | |
tree | c45af5ae82087a14bfc71bbd0292f53ed124fce4 /drivers/nvme/host/core.c | |
parent | 404ec31df434fdae515202952b5e230c1b983ee1 (diff) | |
download | linux-7b210e4ed5e281728243799c5e2b84d3f70d4dd1.tar.xz |
nvme: disable Write Zeroes for qemu controllers
Qemu started out with a broken implementation of Write Zeroes written
by yours truly. Disable Write Zeroes on qemu for now, eventually
we need to go back and make all the qemu quirks version specific,
but that is left for another time.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Tested-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/host/core.c')
-rw-r--r-- | drivers/nvme/host/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index b92fab434066..951e9f31b57c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1531,7 +1531,8 @@ static inline void nvme_config_write_zeroes(struct nvme_ns *ns) u32 max_sectors; unsigned short bs = 1 << ns->lba_shift; - if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES)) + if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_WRITE_ZEROES) || + (ns->ctrl->quirks & NVME_QUIRK_DISABLE_WRITE_ZEROES)) return; /* * Even though NVMe spec explicitly states that MDTS is not |