When a ZFS drive disappears, ZFS sends a resource.fs.zfs.removed event to
userland. A userland program like zfsd(8) can use that event, for example
to activate a hotspare. The current code contains a race condition:
vdev_geom will sent the sysevent _before_ spa.c would update the vdev's
status, causing userland processes to see pool state that does not reflect
the device removal. This change moves the sysevent to spa.c, closing the
race.
Details
Details
It's a race, so it's hard to test. But doing repeated iterations of the
following should work:
- Create a redundant zpool
- Start zfsd
- Pull a drive, wait 2 seconds
- Reinsert drive
- Check that the drive comes back online and resilvers
- Goto 3
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
delphij, please let me know if you feel there would be someone better to review this change. I was looking for somebody from iXSystems, because I think they use ZFS's devctl events.
Comment Actions
The change looks reasonable to me (I don't represent iXsystems, though). Can you make the similar change to vdev_disk.c and upstream?