From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 18 06:36:17 2021 Received: (at 46292) by debbugs.gnu.org; 18 Feb 2021 11:36:17 +0000 Received: from localhost ([127.0.0.1]:46217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lChbU-0005rv-Oy for submit@debbugs.gnu.org; Thu, 18 Feb 2021 06:36:16 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:31388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lChbS-0005ra-FN for 46292@debbugs.gnu.org; Thu, 18 Feb 2021 06:36:15 -0500 X-IronPort-AV: E=Sophos;i="5.81,187,1610406000"; d="scan'208";a="493658226" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Feb 2021 12:36:07 +0100 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 46292@debbugs.gnu.org Subject: Re: bug#46292: =?utf-8?Q?=E2=80=98guix?= environment =?utf-8?Q?-C?= =?utf-8?Q?=E2=80=99?= fails with Linux 4.19 (Debian) References: <87h7ms8658.fsf@inria.fr> Date: Thu, 18 Feb 2021 12:36:07 +0100 In-Reply-To: <87h7ms8658.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Thu, 04 Feb 2021 11:43:47 +0100") Message-ID: <878s7lsj4o.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 46292 Cc: Dimitri DELABROYE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: > The read-only remount comes from =E2=80=98mount-file-system=E2=80=99 in (= gnu build > file-systems): > > ;; For read-only bind mounts, an extra remount is needed, as per > ;; , which still applies to Linux > ;; 4.0. > (when (and (=3D MS_BIND (logand flags MS_BIND)) > (=3D MS_RDONLY (logand flags MS_RDONLY))) > (let ((flags (logior MS_BIND MS_REMOUNT MS_RDONLY))) > (mount source mount-point type flags #f))) > > This recipe has been working well =E2=80=9Cforever=E2=80=9D, although it= =E2=80=99s probably > unnecessary with recent kernels (the LWN article is from 2008). Apparently the extra remount is still necessary, and the =E2=80=98mount=E2= =80=99 command does it for you if you combine =E2=80=98--bind=E2=80=99 with =E2=80=98-o ro= =E2=80=99: --8<---------------cut here---------------start------------->8--- # strace -e mount mount --bind -o ro t m mount("/tmp/t", "/tmp/m", 0xde1930, MS_RDONLY|MS_BIND, NULL) =3D 0 mount("none", "/tmp/m", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) =3D 0 +++ exited with 0 +++ # mount --version mount from util-linux 2.35.1 (libmount 2.35.1: btrfs, namespaces, assert, d= ebug) # uname -sr Linux 5.10.10-gnu --8<---------------cut here---------------end--------------->8--- Ludo=E2=80=99.