file-systems: Fix ‘bcachefs fsck’ exit value logic.

Bit 1 means the target device was mounted read-only whilst checking.
This should never happen in an initrd context but is not an error.

* gnu/build/file-systems.scm (check-bcachefs-file-system): Ignore status
bits that don't signal an error.  Remove the 'reboot-required case.
This commit is contained in:
Tobias Geerinckx-Rice 2020-12-06 11:14:48 +01:00
parent e8528f03f9
commit 23be018d4f
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79

@ -262,14 +262,16 @@ bytevector."
(define (check-bcachefs-file-system device)
"Return the health of a bcachefs file system on DEVICE."
(match (status:exit-val
(let ((ignored-bits (logior 2)) ; DEVICE was mounted read-only
(status
(status:exit-val
(apply system* "bcachefs" "fsck" "-p" "-v"
;; Make each multi-device member a separate argument.
(string-split device #\:)))
(0 'pass)
(1 'errors-corrected)
(2 'reboot-required)
(_ 'fatal-error)))
(string-split device #\:)))))
(match (logand (lognot ignored-bits) status)
(0 'pass)
(1 'errors-corrected)
(_ 'fatal-error))))
;;;