Re: Inhibiting plug and play

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----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-----
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux