Proposal to send DM_UDEV_PRIMARY_SOURCE_FLAG w/ every ioctl sent in devicemapper-rs #389
mulkieran
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The purpose of setting
DM_UDEV_PRIMARY_SOURCE_FLAGis to distinguish a real from a synthetic udev event. When devicemapper code sends an ioctl that is, by definition, real, and associated events are also real. It is most appropriate for us always to set theDM_UDEV_PRIMARY_SOURCE_FLAGfor every ioctl.The programmatically simplest way to do this is to extend
DmOptions::to_ioctl_hdrso that it always sets theDM_UDEV_PRIMARY_SOURCE_FLAG.However, if we do this, certain udev rules that are now not run, because
DM_UDEV_PRIMARY_SOURCEwill be run when stratisd sets up its stack, and the devices will then be exposed.To fix this, we need to make sure the correct cookies are sent when the devices are set up. To do this, we should generalize the commands that create devices so that they take a
create_optionsparameter of typeDmOptionsand in stratisd, we must pass the correct arguments when creating devices. Note that this constitutes a breaking change for devicemapper-rs.For stratisd's purposes, the flags
DM_UDEV_DISABLE_DISK_RULES_FLAG,DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG,DM_UDEV_DISABLE_OTHER_RULES_FLAGare probably the best ones to set.Beta Was this translation helpful? Give feedback.
All reactions