From: Peter Rajnoha <prajnoha@redhat.com>
To: lvm-devel@redhat.com
Subject: Do not decode DM flags for device removal
Date: Mon, 25 Jul 2011 13:09:26 +0200 [thread overview]
Message-ID: <4E2D4EE6.5010204@redhat.com> (raw)
In-Reply-To: <4E2989DC.7070105@gmail.com>
> diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
> index 606a13d..9e8ad0f 100644
> --- a/udev/10-dm.rules.in
> +++ b/udev/10-dm.rules.in
> @@ -24,12 +24,6 @@ ENV{DM_SBIN_PATH}="/sbin"
> TEST!="$env{DM_SBIN_PATH}/dmsetup", ENV{DM_SBIN_PATH}="/usr/sbin"
> TEST!="$env{DM_SBIN_PATH}/dmsetup", GOTO="dm_end"
>
> -# Decode udev control flags and set environment variables appropriately.
> -# These flags are encoded in DM_COOKIE variable that was introduced in
> -# kernel version 2.6.31. Therefore, we can use this feature with
> -# kernels >= 2.6.31 only.
> -ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env{DM_COOKIE}"
> -
> # Device created, major and minor number assigned - "add" event generated.
> # Table loaded - no event generated.
> # Device resumed (or renamed) - "change" event generated.
> @@ -42,6 +36,12 @@ ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env
> # is not recommended.
> ACTION!="add|change", GOTO="dm_end"
>
> +# Decode udev control flags and set environment variables appropriately.
> +# These flags are encoded in DM_COOKIE variable that was introduced in
> +# kernel version 2.6.31. Therefore, we can use this feature with
> +# kernels >= 2.6.31 only.
> +ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env{DM_COOKIE}"
> +
> # Rule out easy-to-detect inappropriate events first.
> ENV{DISK_RO}=="1", GOTO="dm_disable"
Well, for now, this is OK since nobody does any particular action on REMOVE
uevent, neither do we. So we don't actually need to decode any flags, that's
true. But what if someone adds a hook in the future? We also need to consider
any subsystem that makes use of libdevmapper.
So I'd say fine for now, but once there's a hook on REMOVE event anywhere,
expecting the flags to be decoded, we need to take care of proper dependencies
(among foreign packages vs. libdevmapper) if we revert this change back then.
Peter
next prev parent reply other threads:[~2011-07-25 11:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 14:31 Do not decode DM flags for device removal Zdenek Kabelac
2011-07-25 11:09 ` Peter Rajnoha [this message]
2011-07-25 11:16 ` Peter Rajnoha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E2D4EE6.5010204@redhat.com \
--to=prajnoha@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.