linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@redhat.com>
To: Marius Vollmer <marius.vollmer@redhat.com>
Cc: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Identifying useable block devices
Date: Fri, 24 Jan 2014 14:24:56 +0100	[thread overview]
Message-ID: <52E269A8.9090707@redhat.com> (raw)
In-Reply-To: <87y5265106.fsf@red.mvo.lan>

On 01/23/2014 01:35 PM, Marius Vollmer wrote:
> Peter Rajnoha <prajnoha@redhat.com> writes:
> 
>> On 01/22/2014 10:23 AM, Marius Vollmer wrote:
>>
>>> Is it guaranteed (modulo bugs) that the DM_UDEV_DISABLE_*_RULES flags
>>> are only ever removed from a node, and are never added to it over it's
>>> lifetime between add/remove events?
>>
>> No, we don't have this restriction generally
> 
> Ok.
> 
>>> This isn't true right now, and UDisks fails to handle it correctly
>>> when a flag is added in a "change" event.  I am asking to figure out
>>> where the fix should go.
>>
>> Well, udisks should always check the DM_UDEV_DISABLE_OTHER_RULES_FLAG
>> and if it's set, skip its processing. It already has:
>>
>> # honor the flag that device-mapper sets if the device should be ignored
>> ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="udisks_end"
>>
>> ..in 80-udisks.rules. So it should be already following this.
> 
> That's from UDisks 1, I am concerned with UDisks2, which is a quite
> different beast, I think.  Sorry for not making this clear.
> 
> The problem with UDisks2, as I see it, is that it ignores a "change" or
> "add" event that has DM_UDEV_DISABLE_OTHER_RULES_FLAG set, while I think
> it should treat it as a "remove" event.
> 
> I have proposed this patch:
> 
>     https://bugs.freedesktop.org/attachment.cgi?id=92577&action=edit

Well, I don't quite agree with this statement from the patch:
 "We treat the uevent as "remove" if the device-mapper layer
  requests that other rules ignore this uevent".

The flag (DM_UDEV_DISABLE_OTHER_RULES_FLAG) is here to direct
udev processing to skip any scans - it's not actually saying
everyone else should remove this device now. It's just saying
"don't access/touch it" when this flag is set. If there was a
situation where we really need to remove (deactivate) the device,
we'd do that in lvm2 directly within processing of the device.

Also:
 "It's somewhat nasty to do this but it avoids all kinds of
  race-conditions caused by the design of device-mapper
  (such as temporary-cryptsetup nodes and cleartext devices
  without ID_FS properties properly set)."

The only reason we have these flags is that there's no way in
udev to declare the device as being private. The ID_FS_*
properties are the result of the blkid scan. And that's
exactly what we need to avoid! (...one of the reasons is
that such a private device could contain garbage since it's
not yet initialized fully). So it's actually the other way
round...

> 
>> Hmm, could you please send the whole log.
> 
> Sure, attached.
> 

Thanks! Well, sorry for that, I've finally noticed the thing,
that was another bug, unfortunately. Should be solved now with
this git head in lvm2 upstream:
  89d77326170d020ebba6ae1c717c08ac4b07996a
(git.fedorahosted.org/git/lvm2.git)

Thing is that the pool volume *should always* be marked
as private which also means DM_UDEV_DISABLE_OTHER_RULES_FLAG
is set.
-- 
Peter

  reply	other threads:[~2014-01-24 13:24 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15  8:19 [linux-lvm] Identifying useable block devices Marius Vollmer
2014-01-15 15:49 ` Alasdair G Kergon
2014-01-15 16:17 ` Oliver Rath
2014-01-15 20:24   ` Anatoly Pugachev
2014-01-16  1:32     ` Paul B. Henson
2014-01-16  5:42       ` Peter Rajnoha
2014-01-16 21:03         ` Paul B. Henson
2014-01-17  7:54           ` Peter Rajnoha
2014-01-17  9:29             ` Karel Zak
2014-01-17  9:53               ` Peter Rajnoha
2014-01-16  6:04 ` Peter Rajnoha
2014-01-17 10:02 ` Marius Vollmer
2014-01-17 13:35   ` Marius Vollmer
2014-01-20 11:52     ` Peter Rajnoha
2014-01-20 11:49   ` Peter Rajnoha
2014-01-20 12:02     ` Peter Rajnoha
2014-01-22  9:23       ` Marius Vollmer
2014-01-23 11:42         ` Peter Rajnoha
2014-01-23 12:35           ` Marius Vollmer
2014-01-24 13:24             ` Peter Rajnoha [this message]
2014-01-24 13:29               ` Peter Rajnoha
2014-01-24 14:39                 ` Marius Vollmer
2014-01-24 15:02                   ` Peter Rajnoha
2014-01-27  7:37                     ` Marius Vollmer
2014-01-24 14:50               ` Marius Vollmer
2014-01-24 15:08                 ` Peter Rajnoha
2014-01-24 15:17                 ` Zdenek Kabelac
2014-01-24 15:20                   ` Peter Rajnoha
2014-01-22  9:02     ` Marius Vollmer

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=52E269A8.9090707@redhat.com \
    --to=prajnoha@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=marius.vollmer@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).