[PATCH 2/3] nvme-fabrics: check hostid using uuid_equal

Christoph Hellwig hch at lst.de
Thu May 11 06:13:35 PDT 2023


On Wed, May 10, 2023 at 09:02:30PM +0300, Max Gurtovoy wrote:
> 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;
> +	}

Please don't add the pointless braces.  The actual change looks fine to
me, though.



More information about the Linux-nvme mailing list