guix-commits
[Top][All Lists]
Advanced

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

03/03: mapped-devices: Bail out when RAID sources don't show up.


From: Ludovic Courtès
Subject: 03/03: mapped-devices: Bail out when RAID sources don't show up.
Date: Tue, 2 Aug 2016 11:53:55 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 873b51b34057d9d13c628289f57b10dec07b2060
Author: Ludovic Courtès <address@hidden>
Date:   Tue Aug 2 12:34:14 2016 +0200

    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.
---
 gnu/system/mapped-devices.scm |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index 2a0706e..ce0a78a 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)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]