All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: sven@whgl.uni-frankfurt.de
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] renaming of device
Date: Mon, 18 Jan 2010 15:06:03 +0100	[thread overview]
Message-ID: <4B546ACB.6030305@redhat.com> (raw)
In-Reply-To: <3312b5bdf52064429fde163170e925aa.squirrel@ssl.verfeiert.org>

On 01/16/2010 07:52 PM, Sven Eschenberg wrote:
> Short question: When you say, libdevmapper supposely hands creation of
> inodes and links to udev, do you mean really udev, or just creating
> uevents, that can be handled by any hotplug processor?

Both. Block device uevents + required udev rules (provided by lvm2
device-mapper subpackage).

(Note the dm-uevents kernel configure option is only related to multipath path
notification, basic uevents related to DM devices are sent always).

Simplified, it works this way now:

 1) some sybsystem (lvm2, cryptsetup, etc) configures DM-device in kernel and waits for completion

 2) DM (kernel module) send uevent when the device is created/reconfigured/removed

 3) (hotplug) udev device-mapper rule processes event and update /dev/ layout (nodes, symlinks, etc.)
    then sends notification to waiting libdevmapper call from step 1)
    (this notification uses dmsetup triggered from udev rules and system-wide semaphores
     identified by cookie value)

There is still fallback to direct node manipulation - so if it prints something
like "Falling back to direct link creation." something is broken, but libdevmapper
tries to fix it (I guess this fallback will be removed in future.)

Proper device-mapper udev-enabled installation of this require
- recent kernel (>=2.6.31, it must support DM uevent cookie which identifies device)
- recent device-mapper userspace (part of lvm2, now includes also dm udev rules,
must be compiled with udev support)

(Just one note - device-mapper block devices are special, udev rules must react
to change/remove event and ignore "add" event. This is because add event is sent
by block layer too early but device mapper must initialize mapping table etc.)

Also other packages, which scan block devices (device-kit-disks aka udisks)
must be updated to not interfere with udev rules.

Also there was add new read-only uevent in 2.6.32 which breaks old udev rules
(this breaks cryptsetup operation also). So be sure you have new userspace
of everything related before using that udev machinery:-)


> That reminds me, just yesterday on one of my boxes I started getting a
> message, that udev IIRC cannot create some inode, because it is already
> existant (I guess cryptsetup created it as usual), I guess it's another
> sign of those transisitions.

Not sure - it depends if your distributions have all bits mentioned above ready,
and also this can be completely different problem.

I know only that Fedora rawhide now is fully dm udev enabled, not sure about other
distributions.

> On the other hand, dm-uvenets are still marked experimental in current kernels.

See above - this is not related, basic block device uevents are sent always.

Milan

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

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-10 15:16 [dm-crypt] renaming of device Arno Wagner
2010-01-10 19:49 ` Arno Wagner
2010-01-10 20:33   ` Milan Broz
2010-01-11 16:17     ` Arno Wagner
2010-01-13  7:01     ` Luca Berra
2010-01-13 10:20       ` Sven Eschenberg
2010-01-13 13:13         ` Arno Wagner
2010-01-13 16:18           ` Sven Eschenberg
2010-01-13 17:29             ` Arno Wagner
2010-01-14 18:18               ` Sven Eschenberg
2010-01-14 21:42                 ` Arno Wagner
2010-01-14 22:16                   ` Sven Eschenberg
2010-01-14 22:46                     ` Arno Wagner
2010-01-15  2:17                       ` Sven Eschenberg
2010-01-15  3:58                         ` Arno Wagner
2010-01-15 11:28                           ` Sven Eschenberg
2010-01-16  0:30                           ` Ross Boylan
2010-01-16  2:46                             ` Arno Wagner
2010-01-16  8:39                               ` Milan Broz
2010-01-16 16:22                                 ` Arno Wagner
2010-01-16 18:52                                 ` Sven Eschenberg
2010-01-18 14:06                                   ` Milan Broz [this message]
2010-01-18 14:58                                     ` Sven Eschenberg

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=4B546ACB.6030305@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-crypt@saout.de \
    --cc=sven@whgl.uni-frankfurt.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.