From 765dd0e94f53eb8fe875e59b7b3548c109298c0e Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 18 May 2020 21:20:43 +0000 Subject: Add MS_SILENT to most mount() invocations There's an effort to migrate Linux filesystems to handle the y2038 problem, which is great. However, recently a kernel change landed that emits a warning when mounting a filesystem that doesn't handle it, and this notably shows up even when *remounting* e.g. for a read-only bind mount: Using e.g. `rpm-ostree install cowsay` there's a spam of: ``` [ 189.529594] xfs filesystem being remounted at /sysroot supports timestamps until 2038 (0x7fffffff) ``` Now particularly when creating a our bind mounts, let's ask the kernel to be quiet about it. This is not a major event worthy of a kernel log. --- bind-mount.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bind-mount.c') diff --git a/bind-mount.c b/bind-mount.c index 045fa0e..4bd187d 100644 --- a/bind-mount.c +++ b/bind-mount.c @@ -389,7 +389,7 @@ bind_mount (int proc_fd, if (src) { - if (mount (src, dest, NULL, MS_BIND | (recursive ? MS_REC : 0), NULL) != 0) + if (mount (src, dest, NULL, MS_SILENT | MS_BIND | (recursive ? MS_REC : 0), NULL) != 0) return 1; } @@ -411,7 +411,7 @@ bind_mount (int proc_fd, new_flags = current_flags | (devices ? 0 : MS_NODEV) | MS_NOSUID | (readonly ? MS_RDONLY : 0); if (new_flags != current_flags && mount ("none", resolved_dest, - NULL, MS_BIND | MS_REMOUNT | new_flags, NULL) != 0) + NULL, MS_SILENT | MS_BIND | MS_REMOUNT | new_flags, NULL) != 0) return 3; /* We need to work around the fact that a bind mount does not apply the flags, so we need to manually @@ -426,7 +426,7 @@ bind_mount (int proc_fd, new_flags = current_flags | (devices ? 0 : MS_NODEV) | MS_NOSUID | (readonly ? MS_RDONLY : 0); if (new_flags != current_flags && mount ("none", mount_tab[i].mountpoint, - NULL, MS_BIND | MS_REMOUNT | new_flags, NULL) != 0) + NULL, MS_SILENT | MS_BIND | MS_REMOUNT | new_flags, NULL) != 0) { /* If we can't read the mountpoint we can't remount it, but that should be safe to ignore because its not something the user can access. */ -- cgit v1.2.1