[PATCH] nvme: split host and target nvme_auth_extract_key

Hannes Reinecke hare at suse.de
Thu Oct 30 02:45:45 PDT 2025


On 10/30/25 07:01, Christoph Hellwig wrote:
> On Wed, Oct 29, 2025 at 07:57:45AM -0700, Keith Busch wrote:
>> From: Keith Busch <kbusch at kernel.org>
>>
>> The host and target share common code, but the config allows you to
>> disable support for one and not the other. When support is disabled, a
>> stub implementation needs to be used, but that would clash with the real
>> implementation that the other relies on.
>>
>> Split the host and target implementations into uniquely named stub
>> functions that either call the real implementation or return an error if
>> their config option is disabled.
>>
>> Fixes: f59ae5c9e356b5e ("nvme: parse dhchap keys during option parsing")
>> Reported-by: kernel test robot <lkp at intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202510100105.cibujuUJ-lkp@intel.com/
>> Signed-off-by: Keith Busch <kbusch at kernel.org>
> 
> This seems a bit backwards.  How about dropping the stub entirely
> and guard the calls with IS_ENABLED or if needed ifdefs instead?
> 
Tried this once, but then ran into the same issue with one side being
modular and the other side being compiled in.
Can't we just fiddle with config magic to require 
CONFIG_NVME_TARGET_AUTH and CONFIG_NVME_HOST_AUTH
to either be disabled or having the same type
(eg _either_ Y or M). Hmm?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare at suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich



More information about the Linux-nvme mailing list