65878a
From 4c3ce66158917f3fff65e25b5dde622bff3ec6f8 Mon Sep 17 00:00:00 2001
65878a
From: Peter Rajnoha <prajnoha@redhat.com>
65878a
Date: Thu, 6 Mar 2014 15:49:55 +0100
65878a
Subject: [PATCH] rules: mark loop device as SYSTEMD_READY=0 if no file is
65878a
 attached
65878a
65878a
Check existence of loop/backing_file in sysfs and mark loop
65878a
devices with SYSTEMD_READY if missing. Such loop files is
65878a
uninitialized and it's not ready for use yet (there's no file
65878a
attached).
65878a
---
65878a
 rules/99-systemd.rules.in | 3 +++
65878a
 1 file changed, 3 insertions(+)
65878a
65878a
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
65878a
index 0e0a567..0471719 100644
65878a
--- a/rules/99-systemd.rules.in
65878a
+++ b/rules/99-systemd.rules.in
65878a
@@ -25,6 +25,9 @@ SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="
65878a
 # Ignore nbd devices in the "add" event, with "change" the nbd is ready
65878a
 ACTION=="add", SUBSYSTEM=="block", KERNEL=="nbd*", ENV{SYSTEMD_READY}="0"
65878a
 
65878a
+# Ignore loop devices that don't have any file attached
65878a
+ACTION=="add|change", KERNEL=="loop[0-9]*", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0"
65878a
+
65878a
 # We need a hardware independent way to identify network devices. We
65878a
 # use the /sys/subsystem path for this. Current vanilla kernels don't
65878a
 # actually support that hierarchy right now, however upcoming kernels