-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
zvol kqfilter #13773
zvol kqfilter #13773
Conversation
Some previous reviews went here: https://reviews.freebsd.org/D33401 . |
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.
Cool, thanks!
module/os/freebsd/zfs/zvol_os.c
Outdated
@@ -1305,6 +1361,8 @@ zvol_os_free(zvol_state_t *zv) | |||
|
|||
if (dev != NULL) { | |||
ASSERT3P(dev->si_drv2, ==, NULL); | |||
knlist_clear(&zsd->zsd_selinfo.si_note, 0); | |||
knlist_destroy(&zsd->zsd_selinfo.si_note); | |||
destroy_dev(dev); |
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.
I suspect that knlist_clear()/knlist_destroy() should go after destroy_dev(). At least that is what I see in few other places in kernel.
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.
Hmm, I looked through the code a bit to understand why that is. One of the other patterns I noticed were variations of:
destroy_dev()
seldrain()
knlist_clear()
knlist_destroy()
I didn't come up with a confident conclusion - my best guess is that devices with d_poll()
handlers should be destroyed before draining selinfo
. Since the knote list is attached to selinfo
, it would make sense to clear/destroy the knlist after the device is destroyed.
I've updated this chunk of the pull request to be consistent with rest of the kernel.
Before we can merge this there are a few style warnings which need to be resolved, https://github.com/openzfs/zfs/runs/7963871000?check_suite_focus=true |
This will be used to implement kqfilter support for zvol cdevs. Signed-off-by: Rob Wing <rew@FreeBSD.org>
The only event hooked up is NOTE_ATTRIB, which is triggered when the device is resized. Signed-off-by: Rob Wing <rew@FreeBSD.org>
The style issues reported by |
The only event hooked up is NOTE_ATTRIB, which is triggered when the device is resized. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Rob Wing <rew@FreeBSD.org> Closes #13773
This will be used to implement kqfilter support for zvol cdevs. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Rob Wing <rew@FreeBSD.org> Closes openzfs#13773
The only event hooked up is NOTE_ATTRIB, which is triggered when the device is resized. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Rob Wing <rew@FreeBSD.org> Closes openzfs#13773
Motivation and Context
Allow a user to be notified when a zvol with volmode=dev has been resized.
Description
Add kqfilter support to the zvol cdev. This change only applies to zvol with volmode=dev.
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.