chiark / gitweb /
shutdown: ignore loop devices without a backing file
authorKay Sievers <kay@vrfy.org>
Wed, 16 Jan 2013 03:35:54 +0000 (04:35 +0100)
committerKay Sievers <kay@vrfy.org>
Wed, 16 Jan 2013 03:35:54 +0000 (04:35 +0100)
src/core/umount.c

index c7b6cee07975db037d56c1c6ec0d96f2db2a38ae..f0f2711295e9c6536288f232ec3c277f8c37ae93 100644 (file)
@@ -233,6 +233,7 @@ static int loopback_list_get(MountPoint **head) {
         udev_list_entry_foreach(item, first) {
                 MountPoint *lb;
                 struct udev_device *d;
+                const char *backing;
                 char *loop;
                 const char *dn;
 
@@ -241,6 +242,12 @@ static int loopback_list_get(MountPoint **head) {
                         goto finish;
                 }
 
+                backing = udev_device_get_sysattr_value(d, "loop/backing_file");
+                if (!backing) {
+                        udev_device_unref(d);
+                        continue;
+                }
+
                 if (!(dn = udev_device_get_devnode(d))) {
                         udev_device_unref(d);
                         continue;