From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: <hch@lst.de>, <sagi@grimberg.me>, <kbusch@kernel.org>,
<linux-nvme@lists.infradead.org>
Cc: <hare@suse.de>, <axboe@kernel.dk>, <oren@nvidia.com>,
<ngottlieb@nvidia.com>, <israelr@nvidia.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: [PATCH 2/3] nvme-fabrics: check hostid using uuid_equal
Date: Wed, 10 May 2023 21:02:30 +0300 [thread overview]
Message-ID: <20230510180231.18865-3-mgurtovoy@nvidia.com> (raw)
In-Reply-To: <20230510180231.18865-1-mgurtovoy@nvidia.com>
Use a dedicated function to match uuids instead of duplicating it.
Tested-by: Noam Gottlieb <ngottlieb@nvidia.com>
Reviewed-by: Israel Rukshin <israelr@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
drivers/nvme/host/fabrics.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index dcac3df8a5f7..0f3763283222 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -181,8 +181,9 @@ nvmf_ctlr_matches_baseopts(struct nvme_ctrl *ctrl,
ctrl->state == NVME_CTRL_DEAD ||
strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) ||
strcmp(opts->host->nqn, ctrl->opts->host->nqn) ||
- memcmp(&opts->host->id, &ctrl->opts->host->id, sizeof(uuid_t)))
+ !uuid_equal(&opts->host->id, &ctrl->opts->host->id)) {
return false;
+ }
return true;
}
--
2.18.1
next prev parent reply other threads:[~2023-05-10 18:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 18:02 [PATCH v1 0/3] nvme-fabrics: fix un-expected behaviour related to hostnqn and hostid Max Gurtovoy
2023-05-10 18:02 ` [PATCH 1/3] nvme-fabrics: unify common code in admin and io queue connect Max Gurtovoy
2023-05-11 13:12 ` Christoph Hellwig
2023-05-10 18:02 ` Max Gurtovoy [this message]
2023-05-11 13:13 ` [PATCH 2/3] nvme-fabrics: check hostid using uuid_equal Christoph Hellwig
2023-05-11 13:27 ` Max Gurtovoy
2023-05-10 18:02 ` [PATCH 3/3] nvme-fabrics: prevent overriding of existing host Max Gurtovoy
2023-05-11 13:16 ` Christoph Hellwig
2023-05-11 13:26 ` Max Gurtovoy
2023-05-11 13:49 ` Christoph Hellwig
2023-05-11 13:59 ` Max Gurtovoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230510180231.18865-3-mgurtovoy@nvidia.com \
--to=mgurtovoy@nvidia.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=israelr@nvidia.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=ngottlieb@nvidia.com \
--cc=oren@nvidia.com \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox