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

Max Gurtovoy mgurtovoy at nvidia.com
Thu May 11 06:27:37 PDT 2023



On 11/05/2023 16:13, Christoph Hellwig wrote:
> 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.

sorry. probably I forgot to remove after finished debugging..



More information about the Linux-nvme mailing list