[PATCH 1/2] nvme-pci: Fix multiple races in nvme_setup_io_queues()
Keith Busch
kbusch at kernel.org
Tue Jul 6 11:37:26 PDT 2021
On Thu, Jun 24, 2021 at 10:31:24AM -0700, Casey Chen wrote:
> static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
> {
> struct nvme_dev *dev = nvmeq->dev;
> @@ -1590,8 +1613,10 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
> goto release_cq;
>
> nvmeq->cq_vector = vector;
> - nvme_init_queue(nvmeq, qid);
>
> + if ((result = nvme_setup_io_queues_trylock(dev)))
Please separate the assignment to 'result' from the 'if' checking the
result. That way will be easier to read an matches the rest of this
driver's style.
More information about the Linux-nvme
mailing list