On Thu, 2022-01-27 at 09:28 -0800, Bart Van Assche wrote: > On 1/25/22 08:24, mwilck@xxxxxxxx wrote: > > From: Martin Wilck <mwilck@xxxxxxxx> > > > > If a SCSI device handler module is loaded after some SCSI devices > > have already been probed (e.g. via request_module() by dm- > > multipath), > > the "access_state" and "preferred_path" sysfs attributes remain > > invisible for > > these devices, although the handler is attached and live. The > > reason is > > that the visibility is only checked when the sysfs attribute group > > is > > first created. This results in an inconsistent user experience > > depending > > on the load order of SCSI low-level drivers vs. device handler > > modules. > > Isn't this something that should be fixed in the sysfs code rather > than > in the SCSI core? If this issue affects SCSI I assume that it will > also > affect other sysfs users. Well, there's sysfs_update_groups() which could be used for this purpose in principle, I suppose. But there's no API for calling it in the driver core (there is no device_update_groups() or or device_update_attrs()), probably for good reason. Making the attribute visible even if there's no device handler is simpler, and less error-prone. IOW, I agree with Hannes. Regards, Martin