Page MenuHomeFreeBSD

Notify userspace listeners when geom disk attributes have changed
ClosedPublic

Authored by asomers on Apr 14 2016, 5:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 10:33 AM
Unknown Object (File)
Sat, May 4, 10:33 AM
Unknown Object (File)
Thu, Apr 25, 4:31 AM
Unknown Object (File)
Wed, Apr 24, 11:53 AM
Unknown Object (File)
Jan 29 2024, 7:18 PM
Unknown Object (File)
Jan 29 2024, 7:18 PM
Unknown Object (File)
Dec 27 2023, 11:38 PM
Unknown Object (File)
Dec 20 2023, 1:21 AM
Subscribers
None

Details

Summary

Notify userspace listeners when geom disk attributes have changed.

sys/cam/scsi/scsi_da.c:

  • When modifying softc->disk, check to see whether any fields have actually been updated. If so, call disk_attr_changed() with an attribute of "GEOM::diskparams".
  • The ATA equivalent would not benefit from this, because it does not asynchronously update disk parameters; they are set prior to the disk_create() call in cam/ata/ata_da.c:adaregister().

sys/geom/geom_disk.c:

  • disk_attr_changed(): Generate a devctl event of type GEOM:<attr> for every call.
Test Plan

Set devd's loglevel to info, then insert a disk into a SAS expander. /var/log/devd.log should show something like this:

Processing event '!system=GEOM subsystem=disk type=GEOM::diskparams devname=da0

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

asomers retitled this revision from to Notify userspace listeners when geom disk attributes have changed.
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added a reviewer: will.
sys/cam/scsi/scsi_da.c
3845 ↗(On Diff #15198)

Currently, nothing cares about diskparams events. I could revert this part of the change, if my reviewers don't think diskparams events are worthwhile.

sys/geom/geom_disk.c
850 ↗(On Diff #15198)

This is the most important part of the change. Without this, zfsd won't see physpath events, so autoreplace operations won't be reliable.

Decide to revert the diskparams event. Nothing's using it ATM and we can always bring it back later if we want.

Hearing no feedback for a week, I'll go ahead and commit.

This revision was automatically updated to reflect the committed changes.