mirror-linux/drivers/nvme/host
Keith Busch d3205ab75e nvme: fix discard support without oncs
The device can report discard support without setting the ONCS DSM bit.
When not set, the driver clears max_discard_size expecting it to be set
later. We don't know the size until we have the namespace format,
though, so setting it is deferred until configuring one, but the driver
was abandoning the discard settings due to that initial clearing.

Move the max_discard_size calculation above the check for a '0' discard
size.

Fixes: 1a86924e4f ("nvme: fix interpretation of DMRSL")
Reported-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2023-04-05 17:13:17 +02:00
..
Kconfig
Makefile
apple.c nvme-apple: only reset the controller when RTKit is running 2023-01-19 09:08:01 +01:00
auth.c block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
constants.c nvme: add nvme_opcode_str function for all nvme cmd types 2023-02-01 14:22:00 +01:00
core.c nvme: fix discard support without oncs 2023-04-05 17:13:17 +02:00
fabrics.c nvme-fabrics: clarify AUTHREQ result handling 2023-02-01 14:21:58 +01:00
fabrics.h nvme-fabrics: show well known discovery name 2023-02-28 06:14:44 -07:00
fault_inject.c
fc.c nvme-fc: fix initialization order 2023-01-23 17:42:11 +01:00
fc.h
hwmon.c nvme-hwmon: kmalloc the NVME SMART log buffer 2022-10-19 12:43:13 +02:00
ioctl.c block/io_uring: pass in issue_flags for uring_cmd task_work handling 2023-03-20 20:01:25 -06:00
multipath.c block: count 'ios' and 'sectors' when io is done for bio-based device 2023-03-15 09:25:04 -06:00
nvme.h nvme: add nvme_opcode_str function for all nvme cmd types 2023-02-01 14:22:00 +01:00
pci.c nvme-pci: mark Lexar NM760 as IGNORE_DEV_SUBNQN 2023-03-28 10:09:11 +09:00
rdma.c nvme: consolidate setting the tagset flags 2022-12-07 15:02:20 +01:00
tcp.c nvme-tcp: fix a possible UAF when failing to allocate an io queue 2023-03-30 11:24:33 +09:00
trace.c
trace.h
zns.c