Patch "nvmet: don't defer passthrough commands with trivial effects to the workqueue" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nvmet: don't defer passthrough commands with trivial effects to the workqueue

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nvmet-don-t-defer-passthrough-commands-with-trivial-.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7adbfc3596a86ccfbae0d215dfdf7a34cd857290
Author: Christoph Hellwig <hch@xxxxxx>
Date:   Wed Dec 21 09:51:19 2022 +0100

    nvmet: don't defer passthrough commands with trivial effects to the workqueue
    
    [ Upstream commit 2a459f6933e1c459bffb7cc73fd6c900edc714bd ]
    
    Mask out the "Command Supported" and "Logical Block Content Change" bits
    and only defer execution of commands that have non-trivial effects to
    the workqueue for synchronous execution.  This allows to execute admin
    commands asynchronously on controllers that provide a Command Supported
    and Effects log page, and will keep allowing to execute Write commands
    asynchronously once command effects on I/O commands are taken into
    account.
    
    Fixes: c1fef73f793b ("nvmet: add passthru code to process commands")
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Keith Busch <kbusch@xxxxxxxxxx>
    Reviewed-by: Sagi Grimberg <sagi@xxxxxxxxxxx>
    Reviewed-by: Kanchan Joshi <joshi.k@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index 94d3153bae54..09537000d817 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -333,14 +333,13 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req)
 	}
 
 	/*
-	 * If there are effects for the command we are about to execute, or
-	 * an end_req function we need to use nvme_execute_passthru_rq()
-	 * synchronously in a work item seeing the end_req function and
-	 * nvme_passthru_end() can't be called in the request done callback
-	 * which is typically in interrupt context.
+	 * If a command needs post-execution fixups, or there are any
+	 * non-trivial effects, make sure to execute the command synchronously
+	 * in a workqueue so that nvme_passthru_end gets called.
 	 */
 	effects = nvme_command_effects(ctrl, ns, req->cmd->common.opcode);
-	if (req->p.use_workqueue || effects) {
+	if (req->p.use_workqueue ||
+	    (effects & ~(NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC))) {
 		INIT_WORK(&req->p.work, nvmet_passthru_execute_cmd_work);
 		req->p.rq = rq;
 		queue_work(nvmet_wq, &req->p.work);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux