guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: file-systems: 'mount-file-system' preserves the right mount flags


From: guix-commits
Subject: 02/02: file-systems: 'mount-file-system' preserves the right mount flags.
Date: Wed, 10 Mar 2021 17:23:06 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit b665dd4a9902b5722b9e06fd89c203e2221b19e0
Author: Ludovic Courtès <ludovic.courtes@inria.fr>
AuthorDate: Wed Mar 10 18:58:41 2021 +0100

    file-systems: 'mount-file-system' preserves the right mount flags.
    
    Fixes <https://bugs.gnu.org/47007>.
    Reported by Jelle Licht <jlicht@fsfe.org>.
    
    Since commit dcb640f02b1f9590c3bd4301a22bf31bd60c56d4, we could end up
    applying the wrong mount flags because the (find ...) expression could
    pick the "wrong" mount point in the presence of bind mounts.
    
    * gnu/build/file-systems.scm (mount-file-system): Use 'statfs' to
    compute FLAGS whe FS is a bind mount.
---
 gnu/build/file-systems.scm | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index aca4aad..304805d 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -920,14 +920,8 @@ corresponds to the symbols listed in FLAGS."
                           ;; MS_REMOUNT call below fails with EPERM.
                           ;; See <https://bugs.gnu.org/46292>
                           (if (memq 'bind-mount (file-system-flags fs))
-                              (or (and=> (find (let ((devno (stat:dev
-                                                             (lstat source))))
-                                                 (lambda (mount)
-                                                   (= (mount-device-number 
mount)
-                                                      devno)))
-                                               (mounts))
-                                         mount-flags)
-                                  0)
+                              (statfs-flags->mount-flags
+                               (file-system-mount-flags (statfs source)))
                               0)))
          (options (file-system-options fs)))
     (when (file-system-check? fs)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]