From b665dd4a9902b5722b9e06fd89c203e2221b19e0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 10 Mar 2021 18:58:41 +0100 Subject: file-systems: 'mount-file-system' preserves the right mount flags. Fixes . Reported by Jelle Licht . 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(-) (limited to 'gnu/build') diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index aca4aad848..304805db62 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 (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) -- cgit v1.2.3