From b6269fb7bcd2ef7adfb90b148492bb7a62336f92 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 4 May 2021 11:39:08 +0200 Subject: [PATCH] =?UTF-8?q?file-systems:=20Handle=20abnormal=20=E2=80=98bc?= =?UTF-8?q?achefs=20fsck=E2=80=99=20exits.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/build/file-systems.scm (check-bcachefs-file-system): Handle a STATUS:EXIT-VAL of #F. --- gnu/build/file-systems.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 6111cd747c..23ff25d71f 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2016, 2017 David Craven ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Guillaume Le Vaillant -;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice +;;; Copyright © 2019–2021 Tobias Geerinckx-Rice ;;; Copyright © 2019 David C. Trudgian ;;; Copyright © 2020 Maxim Cournoyer ;;; @@ -264,11 +264,12 @@ (define (check-bcachefs-file-system device) "Return the health of a bcachefs file system on DEVICE." (let ((ignored-bits (logior 2)) ; DEVICE was mounted read-only (status + ;; A number, or #f on abnormal termination (e.g., assertion failure). (status:exit-val (apply system* "bcachefs" "fsck" "-p" "-v" ;; Make each multi-device member a separate argument. (string-split device #\:))))) - (match (logand (lognot ignored-bits) status) + (match (and=> status (cut logand <> (lognot ignored-bits))) (0 'pass) (1 'errors-corrected) (_ 'fatal-error))))