systemd/shutdown-ignore-loop-devices-without-backing-file.patch

38 lines
1.2 KiB
Diff
Raw Normal View History

From bdffb521d01a2e2bc342154d74cb519755c52c25 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Wed, 16 Jan 2013 04:35:54 +0100
Subject: [PATCH] shutdown: ignore loop devices without a backing file
---
src/core/umount.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/core/umount.c b/src/core/umount.c
index c7b6cee..f0f2711 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -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;
--
1.7.10.4