summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-08-02 12:34:14 +0200
committerLudovic Courtès <ludo@gnu.org>2016-08-02 13:53:25 +0200
commit873b51b34057d9d13c628289f57b10dec07b2060 (patch)
treefd8fb9d86c4d3af5e68ab54d9dc05bd7c728a5a7 /gnu
parent7f8ad82bf23b032ad6bd85bb1daa87cc83de509c (diff)
downloadguix-873b51b34057d9d13c628289f57b10dec07b2060.tar.gz
mapped-devices: Bail out when RAID sources don't show up.
* gnu/system/mapped-devices.scm (open-raid-device): Bail out after 20
loop iterations.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/system/mapped-devices.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index 2a0706e50b..ce0a78a2ad 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -135,12 +135,16 @@ TARGET (e.g., \"/dev/md0\"), using 'mdadm'."
       (use-modules (srfi srfi-1) (ice-9 format))
 
       (let ((sources '#$sources))
-        (let loop ()
+        (let loop ((attempts 0))
           (unless (every file-exists? sources)
+            (when (> attempts 20)
+              (error "RAID devices did not show up; bailing out"
+                     sources))
+
             (format #t "waiting for RAID source devices~{ ~a~}...~%"
                     sources)
             (sleep 1)
-            (loop)))
+            (loop (+ 1 attempts))))
 
         (zero? (system* (string-append #$mdadm "/sbin/mdadm")
                         "--assemble" #$target sources)))))