From: Scott Talbert <talbert@techie.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: Behavior with duplicate UUID's
Date: Wed, 11 Aug 2010 03:05:38 +0000 [thread overview]
Message-ID: <alpine.LRH.2.00.1008102255140.20499@bear.techie.net> (raw)
In-Reply-To: <alpine.LRH.2.00.1008082106310.18424@bear.techie.net>
On Mon, 9 Aug 2010, Kay Sievers wrote:
> The behavior is undefined, and can only be controlled with
> link_priority= option.
>
> We can't, and don't want to pretend to make any control over 'the
> first one'. In a hotplug world, there is almost never a correct first
> one, because everything runs in parallel.
I agree with you that if two devices are hotplugged at around the same
time, the result would be expectedly unpredictable. However, if you have
your root partition (with a symlink established at bootup), and then hours
later, you hotplug another device, it would seem to me that the symlink of
the older device would be preferable to keep. Right now, the symlink for
the original device is removed and a symlink for the new one is added.
I propose a slightly different change. This changes the symlink priority
processing when the priorities are the same. The oldest symlink is
instead preferred, rather than the newest one.
--- udev-node.c.orig 2010-05-20 11:06:52.000000000 -0400
+++ udev-node.c 2010-08-10 22:52:53.000000000 -0400
@@ -261,9 +261,10 @@
devnode = udev_device_get_devnode(dev_db);
if (devnode != NULL) {
- dbg(udev, "compare priority of '%s'(%i) > '%s'(%i)\n", target, priority,
- udev_device_get_devnode(dev_db), udev_device_get_devlink_priority(dev_db));
- if (target = NULL || udev_device_get_devlink_priority(dev_db) > priority) {
+ dbg(udev, "compare priority of '%s'(%i) >= '%s'(%i)\n",
+ udev_device_get_devnode(dev_db), udev_device_get_devlink_priority(dev_db),
+ target, priority);
+ if (target = NULL || udev_device_get_devlink_priority(dev_db) >= priority) {
info(udev, "'%s' claims priority %i for '%s'\n",
udev_device_get_syspath(dev_db), udev_device_get_devlink_priority(dev_db), stackdir);
priority = udev_device_get_devlink_priority(dev_db);
---
Thanks,
Scott
next prev parent reply other threads:[~2010-08-11 3:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-09 1:19 Behavior with duplicate UUID's Scott Talbert
2010-08-09 8:02 ` Kay Sievers
2010-08-11 3:05 ` Scott Talbert [this message]
2010-08-11 8:17 ` Kay Sievers
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=alpine.LRH.2.00.1008102255140.20499@bear.techie.net \
--to=talbert@techie.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox