-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Notify userspace when a vdev is removed #11260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FreeBSD had this for almost 5 years till OpenZFS import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense. Can you also update this comment in zfs_agent_post_event()
which is now inaccurate to say something like "OpenZFS kernel modules older than 2.0 don't generate an FM_RESOURCE_REMOVED ereport from the vdev_disk layer after a hot unplug. Fortunately we do get an EC_DEV_REMOVE from our disk monitor and it is a suitable proxy so we remap it here for the benefit of the diagnosis engine. Processing multiple FM_RESOURCE_REMOVED events is not harmful.".
/*
* On Linux, we don't get the expected FM_RESOURCE_REMOVED ereport
* from the vdev_disk layer after a hot unplug. Fortunately we do
* get an EC_DEV_REMOVE from our disk monitor and it is a suitable
* proxy so we remap it here for the benefit of the diagnosis engine.
*/
From my reading of the code it should be fine for the ZFS Event Daemon used on Linux to receive multiple copies of this event. So I think we just need to update the comment.
As an aside it looks like the only caller of this function was removed years ago with some other changes which is why it wasn't present in OpenZFS.
This is needed for zfsd to autoreplace vdevs. Signed-off-by: Ryan Moeller <[email protected]>
4f89bb2
to
da1bd1d
Compare
|
This is needed for zfsd to autoreplace vdevs. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11260
This is needed for zfsd to autoreplace vdevs. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11260
This is needed for zfsd to autoreplace vdevs. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11260
This is needed for zfsd to autoreplace vdevs. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11260
Motivation and Context
This is needed for zfsd to autoreplace vdevs on FreeBSD.
Description
Call
zfs_post_remove()
inspa_async_remove()
to tell userspace that the vdev is gone.How Has This Been Tested?
Tested on FreeBSD by setting autoremove=on, starting zfsd, and pulling out a device to confirm a spare replaces it.
Types of changes
Checklist:
Signed-off-by
.