From mboxrd@z Thu Jan 1 00:00:00 1970 From: sjoerd@spring.luon.net (Sjoerd Simons) Date: Mon, 22 Nov 2004 19:38:36 +0000 Subject: [udev] DEVNAME on device removal Message-Id: <20041122193836.GA17405@spring.luon.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" List-Id: To: linux-hotplug@vger.kernel.org --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I just noticed that the DEVNAME enviroment variable isn't being set anymore in udev 0.046 on device removal, while it was being set in 0.042. We're using the property tto do umount -l when a block device is removed. Afaik there is no other way to associate a device with it's DEVNAME on removal ? Also are there cases where doing umount -l on the removed devices is wrong? I guess the device is gone, so there is no sense in keeping it mounted (it's not like the filesystem is gonna come back in a sane state again).. Attached (trivial) patch brings back the DEVNAME variable on device removal. Sjoerd -- The optimist thinks that this is the best of all possible worlds, and the pessimist knows it. -- J. Robert Oppenheimer, "Bulletin of Atomic Scientists" --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="devname.patch" diff -Naur udev-046.orig/udev.c udev-046/udev.c --- udev-046.orig/udev.c 2004-11-18 20:39:15.000000000 +0100 +++ udev-046/udev.c 2004-11-22 18:43:58.000000000 +0100 @@ -179,6 +179,10 @@ /* get node from db, delete it*/ retval = udev_remove_device(&udev); + /* Set the DEVNAME if known */ + if (udev.devname[0] != '\0') { + setenv("DEVNAME", udev.devname, 1); + } /* run scripts */ dev_d_execute(&udev, DEVD_DIR, DEVD_SUFFIX); } --5vNYLRcllDrimb99-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel