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

[Xen-changelog] [xen-unstable] hotplug: fix busy loop device detection



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1305911366 -3600
# Node ID 3b912eb3c6eb5a4fa30f9367ac3b33575de803e7
# Parent  a3118a249ea37cdabbf943507a86d995944ac4ce
hotplug: fix busy loop device detection

Improve busy loop device detection after changeset 22773:02c0af2bf280

The intention is not to find the file to be mounted in the losetup -a
output.  What matters are existing mounted files with the same dev:inode
as the new file.  So the fix is to apply variable expansion which
happens only without double quotes.  Otherwise $dev will contain
newlines for hardlinked files, as mentioned in the commit message from
the changeset above.

losetup -a does also truncate long filenames to 62 chars due to ioctl
limitations.  This part is fixed with 2.6.37 where the filename can be
obtained from sysfs. As a result very long filenames will be missed.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r a3118a249ea3 -r 3b912eb3c6eb tools/hotplug/Linux/block
--- a/tools/hotplug/Linux/block Fri May 20 16:11:13 2011 +0100
+++ b/tools/hotplug/Linux/block Fri May 20 18:09:26 2011 +0100
@@ -280,8 +280,8 @@
           fi
 
           shared_list=$(losetup -a |
-                sed -n -e 
"s@^\([^:]\+\)\(:[[:blank:]]\[${dev}\]:${inode}[[:blank:]](${file})\)@\1@p" )
-          for dev in "$shared_list"
+                sed -n -e 
"s@^\([^:]\+\)\(:[[:blank:]]\[${dev}\]:${inode}[[:blank:]](.*)\)@\1@p" )
+          for dev in $shared_list
           do
             if [ -n "$dev" ]
             then

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.