[PATCH 5/8] nvme-sysfs: add 'tls_configured_key' sysfs attribute

Christoph Hellwig hch at lst.de
Thu Jul 18 22:44:29 PDT 2024


>  #ifdef CONFIG_NVME_TCP_TLS
>  	&dev_attr_tls_key.attr,
> +	&dev_attr_tls_configured_key.attr,
>  #endif
>  	&dev_attr_adm_passthru_err_log_enabled.attr,
>  	NULL
> @@ -741,6 +752,10 @@ static umode_t nvme_dev_attrs_are_visible(struct kobject *kobj,
>  	if (a == &dev_attr_tls_key.attr &&
>  	    (!ctrl->opts || strcmp(ctrl->opts->transport, "tcp")))
>  		return 0;
> +	if (a == &dev_attr_tls_configured_key.attr &&
> +	    (!ctrl->opts || !ctrl->opts->tls_key ||
> +	     strcmp(ctrl->opts->transport, "tcp")))
> +		return 0;
>  #endif

The check for a specific transport hack was ok for a single attribute,
but it probably is time to have a separate attribute_group provided
by the transport now.  Or maybe wait until we get another one..

>  
>  	return a->mode;
> -- 
> 2.35.3
---end quoted text---



More information about the Linux-nvme mailing list