All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH 1/3] Send KOBJ_ADD event after	dm	resume	ioctl.
Date: Fri, 19 Mar 2010 16:05:22 +0100	[thread overview]
Message-ID: <4BA392B2.50903@redhat.com> (raw)
In-Reply-To: <4BA38567.1050106@suse.de>

On 03/19/2010 03:08 PM, Hannes Reinecke wrote:
> As mentioned earlier, CHANGE events do not carry any
> information about _what_ has changed.
> The udev rules / programs are expected to check for
> this themselves. So from that point of view yes, you
> cannot simply wait for 'the' CHANGE event as you
> might get more than one.
> 
> I guess most of this discussion could be solved if
> the CHANGE events would be modify to attach some
> enviroment variables indicating the nature of the change.
> 
> EG adding 'DM_STATE=LIVE' or whatever is appropriate
> here.

As for the variables, we already carry some important
information within uevents.

Generally, it carries hints for udev rules to instruct them
how they should be applied correctly, which parts should be
run based on the type of the device, it's real meaning with all
relations to other devices taken into account within that
DM subsystem used (e.g. LVM2's snapshots, mirrors...).

Most of this information is really not suitable to be stored
as a sysfs attribute since it deals with userspace notions,
an abstraction layer above device-mapper...

So the CHANGE event should carry all this information to
properly do all necessary actions and decisions while processing
the udev rules. This information is not easy to acquire by just
calling some program in userspace (from udev rules as most of
the others do). The device can be in the middle of processing
and that event could be just a part of the whole sequence
(also, it's not only that one device, we deal with all sorts
of relations among devices).

Now, the problem we're hitting are those artificial events
generated as a result of the "watch" rule and "udevadm trigger"
that could be triggered anytime. These are just plain events
that we can't even ignore. We have to apply all the rules for
them, but since we don't have the hints/flags, they are applied
incorrectly (creating nodes/symlinks where it is not appropriate,
calling programs from udev rules that are not appropriate etc.).

The proposal here was to keep such information in udev db
so it's still accessible while processing any of the "artificial"
events.

We can and already do provide some information in uevent's
environment, but the idea is broken by those spurious events.
As mentioned already, we made a proposal to make these bits of
information accessible even for the other events...

And the final solution needs cooperation from both sides.

Peter

  reply	other threads:[~2010-03-19 15:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18 13:58 [PATCH 1/3] Send KOBJ_ADD event after dm resume ioctl Milan Broz
2010-03-18 13:58 ` [PATCH 2/3] Add genhd flag requesting notification of partition changes only Milan Broz
2010-03-18 13:58 ` [PATCH 3/3] Do not send multiple REMOVE events for kobjects Milan Broz
2010-03-18 16:13 ` [PATCH 1/3] Send KOBJ_ADD event after dm resume ioctl Kay Sievers
2010-03-18 17:24   ` Alasdair G Kergon
2010-03-18 21:35   ` Milan Broz
2010-03-19  8:27     ` Kay Sievers
2010-03-19  9:06       ` Lars Ellenberg
2010-03-19  9:24         ` Kay Sievers
2010-03-19  9:49           ` Milan Broz
2010-03-19 10:16             ` Kay Sievers
2010-03-19 11:14               ` Milan Broz
2010-03-19 11:44                 ` Kay Sievers
2010-03-19 12:08                   ` Milan Broz
2010-03-19 12:14                     ` Kay Sievers
2010-03-19 11:50                 ` Hannes Reinecke
2010-03-19 12:00               ` Alasdair G Kergon
2010-03-19 12:12               ` Alasdair G Kergon
2010-03-19 12:16                 ` Kay Sievers
2010-03-19 13:17                   ` Peter Rajnoha
2010-03-19 13:24           ` Peter Rajnoha
2010-03-19 13:43             ` Kay Sievers
2010-03-19 13:47               ` Alasdair G Kergon
2010-03-19 13:58               ` David Zeuthen
2010-03-19 14:34                 ` Alasdair G Kergon
2010-03-19 14:59                   ` David Zeuthen
2010-03-19 15:24                     ` Alasdair G Kergon
2010-03-19 16:01                       ` David Zeuthen
2010-03-19 16:36                         ` Alasdair G Kergon
2010-03-22 10:11                         ` Milan Broz
2010-03-19 15:55                 ` Mike Snitzer
2010-03-19 16:08                   ` David Zeuthen
2010-03-19 14:08             ` Hannes Reinecke
2010-03-19 15:05               ` Peter Rajnoha [this message]
2010-03-19 15:14                 ` David Zeuthen
2010-03-19 15:51                   ` Peter Rajnoha
2010-03-19  9:10       ` Milan Broz
2010-03-19  9:22         ` Kay Sievers
2010-03-19  9:42 ` Hannes Reinecke
2010-03-19 12:27   ` Alasdair G Kergon

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=4BA392B2.50903@redhat.com \
    --to=prajnoha@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    /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.