From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 39698@debbugs.gnu.org
Subject: [bug#39698] [PATCH] file-systems: Set default value of the check? field to #f for NFS
Date: Mon, 24 Feb 2020 11:15:13 -0500 [thread overview]
Message-ID: <87v9nwklm6.fsf@gmail.com> (raw)
In-Reply-To: <87zhdayipo.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 22 Feb 2020 12:17:23 +0100")
[-- Attachment #1.1: Type: text/plain, Size: 1426 bytes --]
Hi Ludovic!
Ludovic Courtès <ludo@gnu.org> writes:
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> --- a/gnu/system/file-systems.scm
>> +++ b/gnu/system/file-systems.scm
>> @@ -101,6 +101,8 @@
>> (define-record-type* <file-system> %file-system
>> make-file-system
>> file-system?
>> + this-file-system
>> +
>> (device file-system-device) ; string | <uuid> | <file-system-label>
>> (mount-point file-system-mount-point) ; string
>> (type file-system-type) ; string
>> @@ -113,7 +115,10 @@
>> (needed-for-boot? %file-system-needed-for-boot? ; Boolean
>> (default #f))
>> (check? file-system-check? ; Boolean
>> - (default #t))
>> + (thunked)
>> + (default (not (string-prefix-ci?
>> + (file-system-type this-file-system)
>> + "nfs"))))
>
> I’d rather avoid making ‘check?’ a thunked field (it adds a bit of
> overhead and breaks ‘equal?’.)
>
> Could we instead special-case NFS in (gnu build file-systems) such that
> checking is a no-op?
>
> Thanks,
> Ludo’.
This actually was the first implementation I'd done, before attempting
to go fancy with the thunked default value ;-).
You'll find it attached.
Thanks!
[-- Attachment #1.2: 0001-build-file-systems-Skip-check-for-NFS-file-systems.patch --]
[-- Type: text/x-patch, Size: 2441 bytes --]
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))
;; Create the mount point. Most of the time this is a directory, but
@@ -683,11 +685,9 @@ corresponds to the symbols listed in FLAGS."
(call-with-output-file mount-point (const #t)))
(mkdir-p mount-point))
- (cond
- ((string-prefix? "nfs" type)
- (mount-nfs source mount-point type flags options))
- (else
- (mount source mount-point type flags options)))
+ (if nfs?
+ (mount-nfs source mount-point type flags options)
+ (mount source mount-point type flags options))
;; For read-only bind mounts, an extra remount is needed, as per
;; <http://lwn.net/Articles/281157/>, which still applies to Linux 4.0.
--
2.25.0
[-- Attachment #1.3: Type: text/plain, Size: 7 bytes --]
Maxim
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2020-02-24 16:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 17:15 [bug#39698] [PATCH] file-systems: Set default value of the check? field to #f for NFS Maxim Cournoyer
[not found] ` <handler.39698.B.158221893829402.ack@debbugs.gnu.org>
2020-02-20 20:29 ` [bug#39698] Acknowledgement ([PATCH] file-systems: Set default value of the check? field to #f for NFS) Maxim Cournoyer
2020-02-22 11:17 ` [bug#39698] [PATCH] file-systems: Set default value of the check? field to #f for NFS Ludovic Courtès
2020-02-24 16:15 ` Maxim Cournoyer [this message]
2020-02-26 20:41 ` Ludovic Courtès
2020-03-03 5:05 ` bug#39698: " Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9nwklm6.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=39698@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.