All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@ubuntu.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Inhibiting plug and play
Date: Tue, 18 Jun 2013 18:40:55 +0000	[thread overview]
Message-ID: <51C0A9B7.6040606@ubuntu.com> (raw)
In-Reply-To: <51C09CA5.6020902@ubuntu.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/18/2013 2:03 PM, David Zeuthen wrote:
> When I was younger I used to think things like this was a good
> idea and, in fact, did a lot of work to add complex interfaces for
> this in the various components you mention. These interfaces didn't
> really work well, someone would always complain that this or that
> edge-case didn't work. Or some other desktop environment ended up
> not using the interfaces. Or some kernel hacker running twm (with
> "carefully" selected bits of GNOME or KDE to get automounting) ran
> into problems. It was awful. Just awful.

I can't really extract any meaning from this without knowledge of what
was tried and what problems it caused.  I also don't see why it can't
be something as simple as opening the device with O_EXCL.

> What _did_ turn out to work really well - and what GNOME is using 
> today and have been for the last couple of years - is that the 
> should_automount flag [1] is set only if, and only if, the device
> the volume is on, has been added within the last five seconds [2].
> It's incredibly simple (and low-tech). And judging from bug
> reports, it works really well.

I don't follow.  You mean udisks delays auto mounting by 5 seconds?
That's not going to help if, for instance, you use gparted to move a
partition to the right.  It first enlarges the partition, which
generates a remove/add event, then starts moving data.  5 seconds
later udisks tries to mount the partition, which very well may succeed
with horrible consequences.

The problem also goes beyond udisks and auto mounting, which is why I
say it really needs done either at the udev or kernel level.

For instance, a udev script may identify the new volume as part of a
raid ( leftover metadata ) and try to attach mdadm to it, at the same
time you're running mkfs.  I'm also pretty sure that I have seen the
mdadm udev script race with mdadm itself while you are trying to
create a new raid volume.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRwKm1AAoJEJrBOlT6nu75ZqMIAM/EUrDIQQn6O5dlCMAOwGSm
h/D5Pbb6amPmDiFELooQgb+BMuUw9bAYwdcukMWZB1MqBTMBOtwLGTeI9TEeWH4y
y2c753e2JBgkPnzY6iFkfPXDvsTEIZSHsx00YLZt06aDL5k/Fmt5eN+mD5pSiC2T
l1qSdhtEw2IseWVuXOjwjy5K00vIDDAaLG1o2Ff135gNx/wUaOK8nL0vSUZhDK96
V3WS4LGKJDlrGESeAyDELfuExrvtmASgohlpUEy2IK9R9lpNicudStPDZFp+dzCA
wv/D1HXkZiIRS74u6Nl3BLtWWd9rPF0ub2OXKCwURYXl2ULE7bPwaiJIdtYp/zo=BWbx
-----END PGP SIGNATURE-----

  parent reply	other threads:[~2013-06-18 18:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 17:45 Inhibiting plug and play Phillip Susi
2013-06-18 17:55 ` Greg KH
2013-06-18 18:03 ` David Zeuthen
2013-06-18 18:40 ` Phillip Susi [this message]
2013-06-18 18:59 ` David Zeuthen
2013-07-16 17:23 ` [systemd-devel] " Lennart Poettering
2013-07-16 17:35 ` Phillip Susi

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=51C0A9B7.6040606@ubuntu.com \
    --to=psusi@ubuntu.com \
    --cc=linux-hotplug@vger.kernel.org \
    /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.