Re: [PATCH v5 23/27] scsi: sd: add multipath disk attr groups

[email protected]
Newsgroups org.kernel.vger.linux-scsi
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The newly defined multipath disk attribute groups are completely unreferenced and never hooked up to the multipath structures, rendering the feature inactive.
--

--- Patch [23]: [PATCH v5 23/27] scsi: sd: add multipath disk attr groups ---
commit 54820f0d02e2f6d8f0530b7358f2376bde300894
Author: John Garry <[email protected]>

scsi: sd: add multipath disk attr groups

This commit adds sysfs attribute groups for multipath disks in the SCSI
subsystem. It defines attributes for delayed disk removal and includes
everything from the existing mpath attribute group.

> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 242a15bc2c5bb..36c745cbb2619 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c

[ ... ]

> +static const struct attribute_group sd_mpath_disk_attr_group = {
> +	.attrs		= sd_mpath_disk_attrs,
> +};
> +
> +__maybe_unused
> +static const struct attribute_group *sd_mpath_disk_attr_groups[] = {
> +	&sd_mpath_disk_attr_group,
> +	&mpath_attr_group,
> +	NULL
> +};

[Severity: Medium]
Are these newly defined multipath disk attribute groups missing a registration
step? 

They are defined here and explicitly marked with __maybe_unused, but do not
appear to be assigned to any registration structure or hooked up to the active
multipath structures. Does this leave the new feature inactive and the
attributes unexposed to userspace?

> +
>  /**
>   *	sd_probe - called during driver initialization and whenever a
>   *	new scsi device is attached to the system. It is called once

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=23
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.