[bug#39698] file-systems: Set default value of the check? field to #f for NFS
diff mbox series

Message ID 878skpcc8k.fsf@gnu.org
State Accepted
Headers show
Series
  • [bug#39698] file-systems: Set default value of the check? field to #f for NFS
Related show

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Ludovic Courtès Feb. 26, 2020, 8:41 p.m. UTC
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> From ca38de33a7a31c7b96f7e920038b2fb6352160a8 Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
> Date: Mon, 24 Feb 2020 11:08:42 -0500
> Subject: [PATCH] build: file-systems: Skip check for NFS file systems
>
> * gnu/build/file-systems.scm (mount-file-system): Do not call
> `check-file-system' when the file system is of NFS type.
> ---
>  gnu/build/file-systems.scm | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
> index cfa3898f83..76c143654d 100644
> --- a/gnu/build/file-systems.scm
> +++ b/gnu/build/file-systems.scm
> @@ -5,6 +5,7 @@
>  ;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
>  ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2019 David C. Trudgian <dave@trudgian.net>
> +;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -663,6 +664,7 @@ corresponds to the symbols listed in FLAGS."
>                                  (string-append "," options)
>                                  "")))))
>    (let* ((type        (file-system-type fs))
> +         (nfs? (string-prefix? "nfs" type))
>           (fs-options (file-system-options fs))
>           (options (if (null? fs-options)
>                        #f
> @@ -671,7 +673,7 @@ corresponds to the symbols listed in FLAGS."
>           (mount-point (string-append root "/"
>                                       (file-system-mount-point fs)))
>           (flags       (mount-flags->bit-mask (file-system-flags fs))))
> -    (when (file-system-check? fs)
> +    (when (and (file-system-check? fs) (not nfs?))
>        (check-file-system source type))

Looking more closely, I see this:

--8<---------------cut here---------------start------------->8---
(define (check-file-system device type)
  "Run a file system check of TYPE on DEVICE."
  (define check-procedure
    (cond
     ((string-prefix? "ext" type) check-ext2-file-system)
     ((string-prefix? "btrfs" type) check-btrfs-file-system)
     ((string-suffix? "fat" type) check-fat-file-system)
     ((string-prefix? "jfs" type) check-jfs-file-system)
     (else #f)))

  (if check-procedure
      …
      (format (current-error-port)
              "No file system check procedure for ~a; skipping~%"
              device)))
--8<---------------cut here---------------end--------------->8---

Isn’t it already taking care of not attempting to check NFS?

Or, to get rid of the warning, what about:
?

Thanks,
Ludo’.

Comments

Maxim Cournoyer March 3, 2020, 5:05 a.m. UTC | #1
Hi again,

> Or, to get rid of the warning, what about:
>
> diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
> index ee6375515f..faf64ce304 100644
> --- a/gnu/build/file-systems.scm
> +++ b/gnu/build/file-systems.scm
> @@ -581,6 +581,7 @@ were found."
>       ((string-prefix? "btrfs" type) check-btrfs-file-system)
>       ((string-suffix? "fat" type) check-fat-file-system)
>       ((string-prefix? "jfs" type) check-jfs-file-system)
> +     ((string-prefix? "nfs" type) (const 'pass))
>       (else #f)))

I've now pushed the above to master.  Closing!

Maxim

Patch
diff mbox series

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index ee6375515f..faf64ce304 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -581,6 +581,7 @@  were found."
      ((string-prefix? "btrfs" type) check-btrfs-file-system)
      ((string-suffix? "fat" type) check-fat-file-system)
      ((string-prefix? "jfs" type) check-jfs-file-system)
+     ((string-prefix? "nfs" type) (const 'pass))
      (else #f)))
 
   (if check-procedure