All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: 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 12:50:49 +0100	[thread overview]
Message-ID: <4BA36519.9040507@suse.de> (raw)
In-Reply-To: <4BA35C90.7000301@redhat.com>

Milan Broz wrote:
> On 03/19/2010 11:16 AM, Kay Sievers wrote:
> 
>> There are several subsystems that depend on updating everything with
>> "change" events when device configurations change. There is nothing
>> inherently wrong with this approach, as long as subsystems send the
>> proper "change" events and don't try to hide anything they have
>> registered.
> 
> ok, this is perfectly fine with dm devices, CHANGE announces all
> changes. Just I am not sure if all consumers of events (and separate
> rules authors) know about that, I saw so many problems with
> failing something when wrongly reacting to ADD event...
> 
> Also it means that after ADD the by-uuid* and similar symlinks
> cannot be yet trusted - if the UUID is read from device and device
> is not yet ready.
> 
Correct. We try to take care of that one by
a) not running something like 'vol_id' for 'ADD' events on dm devices
and
b) really making sure the dm device can be read from when receiving
   CHANGE event.

> Well. And what should happen if anyone generate
> artificial CHANGE event before the real first CHANGE event comes from
> subsystem? (yes, I am looking at you, OPTIONS+="watch" thing for example)
> 
You have to check the device anyway. 'CHANGE' literally just means that,
ie something has changed with the device state.
We used to have 'ONLINE' and 'OFFLINE' events for block devices, but
that got modified to the more generic 'CHANGE' event.

There is _no_ indication what has changed with the device state; any
program etc must check for itself if the device is in a usable state.
(Normally there won't even be any additional environment variables with
a 'CHANGE' event, so one has to look in sysfs anyway to find out what
has changed).

> According to above, rules must be written such way that every ADD/CHANGE
> event must expect that device is not ready, so it can create only
> partial info in udev, is it correct?
Correct.

> (this is of course no problem if the rules are the same for both cases)
> 
Well, yes and no.
We (read: SUSE) are trying to make sure to _not_ run any programs likely
to read data from the disk when receiving 'ADD' events from these devices.

You might get lucky here when the 'ADD' event is in fact a fake as it
was triggered externally, but this is not something I'd bank on.
(And if someone is faking 'ADD' events he can as well do it properly
and fake the corresponding 'CHANGE' events, too)

HTH.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

  parent reply	other threads:[~2010-03-19 11:50 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 [this message]
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
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=4BA36519.9040507@suse.de \
    --to=hare@suse.de \
    --cc=dm-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.