From patchwork Mon Feb 24 16:15:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 20408 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 13E9C27BBEA; Mon, 24 Feb 2020 16:16:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9088A27BBE4 for ; Mon, 24 Feb 2020 16:16:12 +0000 (GMT) Received: from localhost ([::1]:38636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6GOy-0002C5-0S for patchwork@mira.cbaines.net; Mon, 24 Feb 2020 11:16:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38972) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6GOp-0002Ba-TZ for guix-patches@gnu.org; Mon, 24 Feb 2020 11:16:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6GOo-000081-Gg for guix-patches@gnu.org; Mon, 24 Feb 2020 11:16:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48002) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6GOo-00007v-D0 for guix-patches@gnu.org; Mon, 24 Feb 2020 11:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j6GOo-0006jv-7g for guix-patches@gnu.org; Mon, 24 Feb 2020 11:16:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39698] [PATCH] file-systems: Set default value of the check? field to #f for NFS Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 24 Feb 2020 16:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39698 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 39698@debbugs.gnu.org Received: via spool by 39698-submit@debbugs.gnu.org id=B39698.158256092525846 (code B ref 39698); Mon, 24 Feb 2020 16:16:02 +0000 Received: (at 39698) by debbugs.gnu.org; 24 Feb 2020 16:15:25 +0000 Received: from localhost ([127.0.0.1]:53975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j6GO9-0006ik-Sk for submit@debbugs.gnu.org; Mon, 24 Feb 2020 11:15:25 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j6GO8-0006iW-A1 for 39698@debbugs.gnu.org; Mon, 24 Feb 2020 11:15:20 -0500 Received: by mail-qt1-f193.google.com with SMTP id i14so6884641qtv.13 for <39698@debbugs.gnu.org>; Mon, 24 Feb 2020 08:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KovizkTZXzIK4qq1yYLohdUH2D19/CNE+x3igKf+8Eg=; b=JJoud7DAqISgkInmJRdSHPnSKUi8kCz/hSq/h32F9vSmt92lS97Zhi6s7ymK5ohtNh BccL8CA5hA9HcwIvK105jzahvvvXulXvIiPMzqL9QrabeCeGiSTe+e6gIvzwBEjDrpYA UsJIeTnoU6kDMkH824pLRuvf6aLgg0Yf9GpjM4QsMTlsJ3W7AnL1HpjDGD8QPYF5S3xY Dy+Ej/jQPw9dBcyknNBMIcv9B+augShnOvRaedNAVVZm80scUl3ntejSlSud5RJAkiF/ SdEqRNCn0e83H/B5NKVCt/i+FUFGjXvTcA/ZXf5y6mgRnyTGYltMZJVoHNSy/okpwJgW M/nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=KovizkTZXzIK4qq1yYLohdUH2D19/CNE+x3igKf+8Eg=; b=nqQ9qdIfZcXaOROw56kN3iJ7lu6Wv3w+cSCj8InD7/KxOhABwyYY2v2UosBAwIa3EE B/PVsM4WEc1o8XpuLaJGHihDgdaYKwqEmPuxI/YefoWXtTD4hpRAB76heeTiG3lID/6L r8pu9y0xyplCoIVWq4Pq29KqF4QhYzxmyXp3O/xS/VmjSSo8UUmLlttBchmiqiU2syMZ 1dIpSxdHXaCBn+1/UPXNjORD6M1ZulNaUWf5A3px4R80/YDvq6dZril5SohLu20C8acI EK9ev+XLS6Djb+QnmzZNkkwrUmIhqfOtiulqFZ3bnt1BjW0JwtIcqwCXHof9QdGoe5w/ Wb6A== X-Gm-Message-State: APjAAAVxfwtbP+Pyto/Px2Q7zDudmvKw8h9cHuDeMxISka9YxM8eG3bN nP7gW5aSTrpFoIwCGm4DDtUjjZnx X-Google-Smtp-Source: APXvYqyVuabfqFEK3NKnyjm2K643vmOsXr6jae+k+TIbqQk3QhMaaDnZlHefxF/ar9ZXbtom82p84A== X-Received: by 2002:ac8:10d:: with SMTP id e13mr47524598qtg.294.1582560914618; Mon, 24 Feb 2020 08:15:14 -0800 (PST) Received: from raisin ([2607:fad8:4:6:235e:8579:8464:aacc]) by smtp.gmail.com with ESMTPSA id w2sm6212138qtd.97.2020.02.24.08.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 08:15:14 -0800 (PST) From: Maxim Cournoyer References: <87d0a9i3il.fsf@gmail.com> <87zhdayipo.fsf@gnu.org> Date: Mon, 24 Feb 2020 11:15:13 -0500 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") Message-ID: <87v9nwklm6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi Ludovic! Ludovic Courtès writes: > Hi, > > Maxim Cournoyer skribis: > >> --- a/gnu/system/file-systems.scm >> +++ b/gnu/system/file-systems.scm >> @@ -101,6 +101,8 @@ >> (define-record-type* %file-system >> make-file-system >> file-system? >> + this-file-system >> + >> (device file-system-device) ; string | | >> (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! Maxim From ca38de33a7a31c7b96f7e920038b2fb6352160a8 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer 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 ;;; Copyright © 2019 Tobias Geerinckx-Rice ;;; Copyright © 2019 David C. Trudgian +;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; 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 ;; , which still applies to Linux 4.0. -- 2.25.0