All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Fix udev rules to take into account recent changes in udev and deal with coldplug problem at boot
Date: Mon, 14 Jun 2010 16:26:48 +0200	[thread overview]
Message-ID: <4C163C28.5030600@redhat.com> (raw)
In-Reply-To: <4C163459.10005@redhat.com>

On 06/14/2010 03:53 PM, Peter Rajnoha wrote:

> +# Normally, we operate on "change" events. But when coldplugging, there's an
> +# "add" event present. We have to recognize this and do our actions in this
> +# particular situation, too. Also, we don't want the nodes to be created
> +# prematurely on "add" events while not coldplugging. We check
> +# DM_UDEV_PRIMARY_SOURCE_FLAG to see if the device was activated correctly
> +# before and if not, we ignore the "add" event totally. This way we can support
> +# udev triggers generating "add" events (e.g. "udevadm trigger --action=add" or
> +# "echo add > /sys/block/<dm_device>/uevent"). The trigger with "add" event is
> +# also used at boot to reevaluate udev rules for all existing devices activated
> +# before (e.g. in initrd). If udev is used in initrd, we require the udev init
> +# script to not remove the existing udev database so we can reuse the information
> +# stored at the time of device activation in the initrd.
> +ACTION=="add", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="dm_disable"

Addendum for a gentle reviewer:

GOTO="dm_disable" sets these values to safe defaults, so other rules
can ignore that event for dm device as well (e.g. udisks):

LABEL="dm_disable"                                                                                                                                                                      
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="1"
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"


Ack.

Milan



      reply	other threads:[~2010-06-14 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 13:53 [PATCH] Fix udev rules to take into account recent changes in udev and deal with coldplug problem at boot Peter Rajnoha
2010-06-14 14:26 ` Milan Broz [this message]

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=4C163C28.5030600@redhat.com \
    --to=mbroz@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.