summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/fabrics-cmd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-09-20 15:37:18 +0200
committerChristoph Hellwig <hch@lst.de>2022-09-27 09:22:09 +0200
commit1befd944e05050d76950014f3dc04ed47faba2c3 (patch)
tree1524442d9f75fbab5a8c6135d35c6f980ca39c9e /drivers/nvme/target/fabrics-cmd.c
parent0700542a823ba3d3aa9c699a255aecc23dbbcaff (diff)
downloadlinux-1befd944e05050d76950014f3dc04ed47faba2c3.tar.bz2
nvmet-auth: don't try to cancel a non-initialized work_struct
Currently blktests nvme/002 trips up debugobjects if CONFIG_NVME_AUTH is enabled, but authentication is not on a queue. This is because nvmet_auth_sq_free cancels sq->auth_expired_work unconditionaly, while auth_expired_work is only ever initialized if authentication is enabled for a given controller. Fix this by calling most of what is nvmet_init_auth unconditionally when initializing the SQ, and just do the setting of the result field in the connect command handler. Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/nvme/target/fabrics-cmd.c')
-rw-r--r--drivers/nvme/target/fabrics-cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
index c1dfdfb92ebf..c7e903589d37 100644
--- a/drivers/nvme/target/fabrics-cmd.c
+++ b/drivers/nvme/target/fabrics-cmd.c
@@ -272,7 +272,8 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)
req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
if (nvmet_has_auth(ctrl))
- nvmet_init_auth(ctrl, req);
+ req->cqe->result.u32 |=
+ cpu_to_le32((u32)NVME_CONNECT_AUTHREQ_ATR << 16);
out:
kfree(d);
complete:
@@ -333,7 +334,8 @@ static void nvmet_execute_io_connect(struct nvmet_req *req)
pr_debug("adding queue %d to ctrl %d.\n", qid, ctrl->cntlid);
if (nvmet_has_auth(ctrl))
- nvmet_init_auth(ctrl, req);
+ req->cqe->result.u32 |=
+ cpu_to_le32((u32)NVME_CONNECT_AUTHREQ_ATR << 16);
out:
kfree(d);