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)
Sun, Jan 26, 7:31 PM
Unknown Object (File)
Tue, Jan 21, 6:39 AM
Unknown Object (File)
Sat, Jan 4, 6:56 AM
Unknown Object (File)
Dec 24 2024, 12:58 AM
Unknown Object (File)
Nov 9 2024, 3:16 PM
Unknown Object (File)
Nov 3 2024, 3:05 AM
Unknown Object (File)
Oct 30 2024, 10:06 AM
Unknown Object (File)
Oct 19 2024, 3:44 PM
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.