From 4d8d1119a2df0914a408e8aef2d7129bb952f899 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Wed, 8 May 2024 07:12:26 -0400 Subject: [PATCH] mount: reduce failure noise Change-Id: I2709a4a220f6d1db42e5259e0a883d4c74066bef Signed-off-by: Ashod Nakashian --- tools/mount.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/mount.cpp b/tools/mount.cpp index 588373a95a..3b2e38346e 100644 --- a/tools/mount.cpp +++ b/tools/mount.cpp @@ -190,9 +190,17 @@ int main(int argc, char** argv) retval = umount2(target, MNT_FORCE); if (retval != 0) { - // Complain to capture the reason of failure. - fprintf(stderr, "%s: forced unmount of [%s] failed: %s.\n", program, target, - strerror(errno)); + // From man umount(2), MNT_FORCE is not commonly supported: + // As at Linux 4.12, MNT_FORCE is supported only on the following filesystems: 9p (since + // Linux 2.6.16), ceph (since Linux 2.6.34), cifs (since Linux 2.6.12), + // fuse (since Linux 2.6.16), lustre (since Linux 3.11), and NFS (since Linux 2.1.116). + if (errno != EINVAL) + { + // Complain to capture the reason of failure. + fprintf(stderr, "%s: forced unmount of [%s] failed: %s.\n", program, target, + strerror(errno)); + } + return EX_SOFTWARE; } }