From: Milan Broz <mbroz@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: David Zeuthen <zeuthen@gmail.com>
Subject: Re: [PATCH 1/3] Send KOBJ_ADD event after dm resume ioctl.
Date: Mon, 22 Mar 2010 11:11:09 +0100 [thread overview]
Message-ID: <4BA7423D.6000305@redhat.com> (raw)
In-Reply-To: <7b13a0f81003190901o225df427o4468700888501177@mail.gmail.com>
On 03/19/2010 05:01 PM, David Zeuthen wrote:
Hi,
> If you wanted to solve the problem kernel-side I'd expect you to
> create a new subsytem for device-mapper (let's call it 'kdm') that
> libdevmapper would talk to. Then you'd only present block device
> objects exactly when the device-mapper side has been configured.
>
> Then the flow of events could be something like this
>
> - add device kdm-0 (subsys 'kdm')
> - libdevmapper configures kdm-0
> - add device dm-0 (subsys 'block')
>
> but I don't know if this is better.
Nope. device-mapper constructs block devices into other block devices,
it just use some more complex trees (in comparison with MD) and
so you just see these device trees from userspace.
Visibility of all these devices is surely useful when you want to construct
something special without high-level abstraction (like lvm2)
(e.g. liveCD uses snapshots this way).
I want to say, with all the rules Kay just written in some previous mail,
these newly allocated block devices should be present
in sysfs and /dev in kobject creation time.
And btw there is no problem on kernel side using this definition -
ADD/CHANGE event is generated properly, all scans on "unconfigured"
(= no table) device fails.
The problem is in userspace synchronisation.
And device-mapper is nothing special here - what happens if someone
trigger change event before mkfs open the plain disk?
mkfs can fail because device can be locked by asynchronous scan.
(and udev settle is not always option)
> The 'private device
> attribute' we suggested offers another - all would be expected
> to respect a 'private' sysfs attribute.
>
>
> Sorry, but this is an even worse hack. Mandating that all of user
> space (that is: past, present and future) needs to read some
> random 'private' attribute in sysfs because of weird life-cycle
> issues in the device-mapper implementation... that's not really
> workable.
If all you have is a hammer, everything looks like a nail.
Sure, we can scan everything what is in system and expect that
it responds "Error 418 I'm a teapot!" and we can fail gracefully :-)
You simply have to distinguish some differences in device types,
and you are already doing that. (See above why special subsystem
is not good idea IMHO.)
What is interesting, that the private attribute comes from udev
world (when discussing cryptsetup problem. NO other application must
read keyslot device, because it contains key related material).
(It is done this way, because it can this way use kernel crypto
for key obfuscation - and it was 3rd party design.)
See https://bugzilla.redhat.com/show_bug.cgi?id=528909#c8
(yes, it is your comment)
It is generic concept. Now it is wrong. Why?
> Anyway, I really don't think you can expect user space to behave
> sanely so it's not really worth trying.
>
> (I don't think you ever could expect user space to behave sanely,
> but I'll note that it's an even bigger problem now that we have
> powerful frameworks (such as udev) allowing people to run code
> at device discovery time.... I mean, device-mapper have probably
> been suffering from these issues from day 1 - it just wasn't visible
> earlier on because we didn't have uevents...)
Sounds more like anarchy:-) Device-mapper is also very powerful
system (btw lvm2 uses quite small part of its abilities).
So we have several "powerful" systems and we want to work them together
(and keep the plane flying and not crash).
That means that during the flight some rules must apply. That's all.
Milan
--
mbroz@redhat.com
next prev parent reply other threads:[~2010-03-22 10:11 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 [this message]
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=4BA7423D.6000305@redhat.com \
--to=mbroz@redhat.com \
--cc=dm-devel@redhat.com \
--cc=zeuthen@gmail.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.