-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add events to zed and minor tweaks. #12416
Conversation
@lundman I'm back from vacation - I'll take a look at this. |
Would you mind squashing these commits? There seems to be some churn between them. |
Would you mind squashing these commits? There seems to be some churn between them. Not at all, one-commit next push. |
I'm also wondering if for the pthread names, instead of #ifdefs everywhere, perhaps we could define 2 macros: use both args in zed source files, but one macro is empty, depending on platform? |
I personally like the more verbose #ifdefs, because it's apparent that you're doing something special for OSX for the pthread names. If you use the macros, it could lead the casual reader getting confused:
"dude... why is it setting the thread name twice?" |
Once the last two outstanding comments get fixed, I think this will be good to go. |
I believe I have updated for both comments, let me know if you want further tweaking. |
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 really don't have a good solution to the pthread_setname_np()
issue since it's used so differently. It seems like we might need to live with the #ifdefs
.
It seems to me it would be useful to post these new events on all platforms. That would allow users to create their own zedlets to do interesting things with them. Even if we still for example on Linux rely on udev to create the links and not the ZED. Plus it means we won't be merging any dead code with this PR, which would be good.
4515062
to
c5f227a
Compare
For kernel to send snapshot mount/unmount events to zed. For kernel to send symlink creates/removes on zvol plumbing. (/dev/run/dsk/zvol/$pool/$zvol -> /dev/diskX) If zed misses the ENODEV, all errors after are EINVAL. Treat any error as kernel module failure. Signed-off-by: Jorgen Lundman <[email protected]>
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.
Thanks for sticking with this @lundman
I'm just happy we are allowed to use |
For Linux you'll want to place the call in the
Yes, that's pretty much what I had in mind. Although now I'm second guessing myself since I'm not sure we really have a solid use case for it yet on other platforms. For the moments let's leave it as you had it originally and not call |
I think your device names makes sense on linux, I don't actually know what udev produces? At least on illumos, you know the zvol is The zedlet only get
Leaving it as it is. |
Thanks for linking the zedlet that helped clear things up. I see what you're saying, that makes sense. Just thinking out loud, but would having the device major:minor numbers be helpful as well?
That's actually sounds pretty similar to how it currently works on Linux. In the udev event we actually only get the |
Passing along major,minor could be useful for some platforms, sort of the future guessing I was trying to do with raw-device name. Any changes desired for this PR? |
@lundman I think I've derailed things enough for the time being. Since we've got the needed reviews let me just go ahead and get this merged so you can build on it. Thanks for your patience! |
For kernel to send snapshot mount/unmount events to zed. For kernel to send symlink creates/removes on zvol plumbing. (/dev/run/dsk/zvol/$pool/$zvol -> /dev/diskX) If zed misses the ENODEV, all errors after are EINVAL. Treat any error as kernel module failure. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#12416
For kernel to send snapshot mount/unmount events to zed. For kernel to send symlink creates/removes on zvol plumbing. (/dev/run/dsk/zvol/$pool/$zvol -> /dev/diskX) If zed misses the ENODEV, all errors after are EINVAL. Treat any error as kernel module failure. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes openzfs#12416
Collected all
zed
changes into one PR.Motivation and Context
Description
This PR comes in 3 parts;
Work around different pthread setname. macOS can only set name from child thread.How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.