From 2ffc9cc1917b1bb6fe86881a94a47dce9aa15168 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 19 Aug 2009 20:49:49 +0200 Subject: change database file names With very deeply nested devices, We can not use a single file name to carry an entire DEVPATH. Use : as the database filename, which should also simplify the handling of devices moving around, as these values will not change but still be unique. For the name stack we use the : now as the filename. > On Tue, Aug 18, 2009 at 09:59:56AM -0400, Ric Wheeler wrote: > The first is that udev grumbles during boot about "file name too long" > like the following: > > Aug 17 06:49:58 megadeth udevd-event[20447]: unable to create db file > '/dev/.udev/db/\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2f0000:17:00.0\x2f0000:18:0a.0\x2f0000:1f:00.0\x2fhost11\x2fport-11:0\x2fexpander-11:0\x2fport-11:0:0\x2fexpander-11:1\x2fport-11:1:0\x2fexpander-11:2\x2fport-11:2:17\x2fexpander-11:3\x2fport-11:3:1\x2fend_device-11:3:1\x2fbsg\x2fend_device-11:3:1': > File name too long --- udev/udev-event.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'udev/udev-event.c') diff --git a/udev/udev-event.c b/udev/udev-event.c index f3c2bd2225..3a6c71abe9 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -531,10 +531,12 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) struct udev_device *dev = event->dev; int err = 0; - if (udev_device_get_devpath_old(dev) != NULL) { - if (udev_device_rename_db(dev, udev_device_get_devpath(dev)) == 0) - info(event->udev, "moved database from '%s' to '%s'\n", - udev_device_get_devpath_old(dev), udev_device_get_devpath(dev)); + if (udev_device_get_sysname_old(dev) != NULL && + strcmp(udev_device_get_sysname_old(dev), udev_device_get_sysname(dev)) != 0) { + udev_device_rename_db(dev); + info(event->udev, "moved database from '%s:%s' to '%s:%s'\n", + udev_device_get_subsystem(dev), udev_device_get_sysname_old(dev), + udev_device_get_subsystem(dev), udev_device_get_sysname(dev)); } /* add device node */ -- cgit v1.2.3-54-g00ecf