Skip to content

Conversation

@tbzatek
Copy link
Member

@tbzatek tbzatek commented Oct 21, 2025

This lays down a foundation for tracking NVMe subsystems, effectively creating uevent broadcast groups. This allows drive and block objects to receive uevents targeted for other devices in the subsystem.

@tbzatek tbzatek force-pushed the uevent-pre-post branch 2 times, most recently from c336aaf to 00a1118 Compare October 29, 2025 17:05
@tbzatek

This comment was marked as duplicate.

1 similar comment
@tbzatek

This comment was marked as duplicate.

@storaged-project storaged-project deleted a comment from tbzatek Nov 3, 2025
@vojtechtrefny

This comment was marked as outdated.

@tbzatek

This comment was marked as outdated.

1 similar comment
@tbzatek

This comment was marked as outdated.

With the planned uevent action extension of pre-/post- actions the string
comparison gets quite heavy. Better to use numeric constants to spare
some CPU cycles.
This lays down a foundation for tracking NVMe subsystems, effectively
creating uevent broadcast groups. This allows drive and block objects
to receive uevents targeted for other devices in the subsystem.
In certain situations, e.g. when the kernel host nvme driver failed
to probe the device or when the controller was not in a 'live' state,
an invalid Subsystem NQN values may appear in sysfs. In such a case
subsystem tracking should be skipped with an expectation of another
uevent once the controller recovers or becomes live.

The commonly seen values are '(efault)' and '(null)'. See also
https://www.kernel.org/doc/Documentation/core-api/printk-formats.rst
@tbzatek
Copy link
Member Author

tbzatek commented Dec 21, 2025

This still seems to fail in a few percent of cases in test_ns_detach:

======================================================================
FAIL: test_ns_detach (test_nvme.UdisksNVMeTest.test_ns_detach)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tbzatek/devel/udisks/src/tests/dbus-tests/test_nvme.py", line 624, in test_ns_detach
    self.assertHasIface(ns, 'org.freedesktop.UDisks2.NVMe.Namespace')
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tbzatek/devel/udisks/src/tests/dbus-tests/udiskstestcase.py", line 504, in assertHasIface
    raise AssertionError("Object '%s' has no interface '%s'" % (obj.object_path, iface))
AssertionError: Object '/org/freedesktop/UDisks2/block_devices/nvme0n2' has no interface 'org.freedesktop.UDisks2.NVMe.Namespace'

@tbzatek

This comment was marked as outdated.

…vent

Update block and drive object interfaces on an incoming NVMe subsystem
uevent. This allows to properly reflect the state of a NVMe subsystem
native multipath where one path disappears and uevents are sent only to
a limited number of devices.

This allows e.g. to update Drive property references once the
primary/active path/controller disappears and another one in the subsystem
takes over.
Despite that UDisksLinuxProvider should register and process incoming
uevent for the newly connected controller(s), the purpose of triggering
additional subsystem uevent is to ensure all objects are up to date
upon the Connect() method call return.
Trigger a synchronous subsystem uevent so that all objects in
the subsystem are fully updated upon the method call return.
@tbzatek tbzatek changed the title [WIP] udiskslinuxprovider: Track NVMe subsystems udiskslinuxprovider: Track NVMe subsystems Dec 22, 2025
@tbzatek tbzatek marked this pull request as ready for review December 22, 2025 12:34
@tbzatek
Copy link
Member Author

tbzatek commented Dec 22, 2025

Tests seem to be stable for the past couple of runs, ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants