[PATCH 3/6] nvme-auth: use xarray instead of linked list
Christoph Hellwig
hch at lst.de
Wed Nov 2 01:03:19 PDT 2022
> @@ -907,33 +915,28 @@ EXPORT_SYMBOL_GPL(nvme_auth_negotiate);
> int nvme_auth_wait(struct nvme_ctrl *ctrl, int qid)
> {
> struct nvme_dhchap_queue_context *chap;
> - int ret;
>
> + chap = xa_load(&ctrl->dhchap_auth_xa, qid);
> + if (!chap) {
> + dev_warn(ctrl->device,
> + "qid %d: authentication not initialized!",
> + qid);
> + return -ENOENT;
> }
> + flush_work(&chap->auth_work);
What protects chap from going away after the load, but before use?
More information about the Linux-nvme
mailing list