Skip to content

Commit

Permalink
nvme-pci: skip nvme_write_sq_db on empty rqlist
Browse files Browse the repository at this point in the history
nvme_submit_cmds() should check the rqlist before calling
nvme_write_sq_db(); if the list is empty, it must return immediately.

Fixes: beadf00 ("nvme-pci: reverse request order in nvme_queue_rqs")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
  • Loading branch information
Maurizio Lombardi authored and Keith Busch committed Apr 1, 2025
1 parent 32c9281 commit 288ff0d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,9 @@ static void nvme_submit_cmds(struct nvme_queue *nvmeq, struct rq_list *rqlist)
{
struct request *req;

if (rq_list_empty(rqlist))
return;

spin_lock(&nvmeq->sq_lock);
while ((req = rq_list_pop(rqlist))) {
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
Expand Down

0 comments on commit 288ff0d

Please sign in to comment.