[PATCH v6 6/6] nvme: sysfs: emit the marginal path state in show_state()

Hannes Reinecke hare at suse.de
Sat Jun 21 06:36:42 PDT 2025


On 6/20/25 19:58, Bryan Gurney wrote:
> If a controller has received a link integrity or congestion event, and
> has the NVME_CTRL_MARGINAL flag set, emit "marginal" in the state
> instead of "live", to identify the marginal paths.
> 
> Co-developed-by: John Meneghini <jmeneghi at redhat.com>
> Signed-off-by: John Meneghini <jmeneghi at redhat.com>
> Signed-off-by: Bryan Gurney <bgurney at redhat.com>
> ---
>   drivers/nvme/host/sysfs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
> index 29430949ce2f..4a6135c2f9cb 100644
> --- a/drivers/nvme/host/sysfs.c
> +++ b/drivers/nvme/host/sysfs.c
> @@ -430,7 +430,9 @@ static ssize_t nvme_sysfs_show_state(struct device *dev,
>   	};
>   
>   	if (state < ARRAY_SIZE(state_name) && state_name[state])
> -		return sysfs_emit(buf, "%s\n", state_name[state]);
> +		return sysfs_emit(buf, "%s\n",
> +			(nvme_ctrl_is_marginal(ctrl)) ? "marginal" :
> +			state_name[state]);
>   
>   	return sysfs_emit(buf, "unknown state\n");
>   }
Reviewed-by: Hannes Reinecke <hare at suse.de>

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