From: Karel Zak Date: Fri, 21 Jan 2022 11:24:43 +0000 (+0100) Subject: findmnt: add reason to "cannot detect on-disk filesystem type" warning X-Git-Tag: v2.38-rc1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e209dd35d2b116e0b8ccf3dd0436a0783cc4e572;p=thirdparty%2Futil-linux.git findmnt: add reason to "cannot detect on-disk filesystem type" warning References: https://unix.stackexchange.com/questions/563688/findmnt-verify-gives-warning-cannot-detect-on-disk-filesystem-type Signed-off-by: Karel Zak --- diff --git a/misc-utils/findmnt-verify.c b/misc-utils/findmnt-verify.c index 624c7205e8..609638c4d1 100644 --- a/misc-utils/findmnt-verify.c +++ b/misc-utils/findmnt-verify.c @@ -443,13 +443,17 @@ static int verify_fstype(struct verify_context *vfy) if (!isswap && !isauto && !none && !is_supported_filesystem(vfy, type)) verify_warn(vfy, _("%s seems unsupported by the current kernel"), type); } + + errno = 0; realtype = mnt_get_fstype(src, &ambi, cache); if (!realtype) { + const char *reson = errno ? strerror(errno) : _("reason uknown"); + if (isauto) - verify_err(vfy, _("cannot detect on-disk filesystem type")); + verify_err(vfy, _("cannot detect on-disk filesystem type (%s)"), reson); else - verify_warn(vfy, _("cannot detect on-disk filesystem type")); + verify_warn(vfy, _("cannot detect on-disk filesystem type (%s)"), reson); goto done; }