Re: [PATCH] nvme-pci: Use u32 for nvme_dev.q_depth and nvme_queue.q_depth

2020-08-15 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH] nvme-pci: Use u32 for nvme_dev.q_depth and nvme_queue.q_depth

2020-08-14 Thread Sagi Grimberg
queued to nvme-5.9-rc

Re: [PATCH] nvme-pci: Use u32 for nvme_dev.q_depth and nvme_queue.q_depth

2020-08-14 Thread Keith Busch
On Fri, Aug 14, 2020 at 11:34:25PM +0800, John Garry wrote: > Fix by making onto a u32. > > Also use u32 for nvme_dev.q_depth, as we assign this value from > nvme_dev.q_depth, and nvme_dev.q_depth will possibly hold 65536 - this > avoids the same crash as above. > > Fixes: 61f3b8963097

[PATCH] nvme-pci: Use u32 for nvme_dev.q_depth and nvme_queue.q_depth

2020-08-14 Thread John Garry
Recently nvme_dev.q_depth was changed from an int to u16 type. This falls over for the queue depth calculation in nvme_pci_enable(), where NVME_CAP_MQES(dev->ctrl.cap) + 1 may overflow as a u16, as NVME_CAP_MQES() is a 16b number also. That happens for me, and this is the result: