]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: fix misleading warning messages for ntfs3
authorKarel Zak <kzak@redhat.com>
Tue, 13 Jan 2026 17:38:24 +0000 (18:38 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 14 Jan 2026 12:05:56 +0000 (13:05 +0100)
* Remap fstab aliases like "ntfs3" to "ntfs" as reported by libblkid.

* Use mounttype (from --with-ntfs-mounttype=) to check if supported by
  the kernel rather than the type provided by libblkid.

* Don't check if the kernel supports type read from filesystem if an
  explicit type specified in fstab.

Fixes: https://github.com/util-linux/util-linux/issues/3912
Addresses: https://github.com/util-linux/util-linux/pull/3963
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/findmnt-verify.c

index 2a220dc5964f827744876ca39735ac0f3466cb2b..ed0250353270b298750c269d377af8f20ec9d7bc 100644 (file)
@@ -17,6 +17,7 @@
 #include "xalloc.h"
 #include "pathnames.h"
 #include "match.h"
+#include "mountutils.h"
 
 #include "findmnt.h"
 
@@ -461,16 +462,28 @@ static int verify_fstype(struct verify_context *vfy, struct findmnt *findmnt)
        }
 
        if (realtype) {
+               const char *mounttype;
+
                isswap = strcmp(realtype, "swap") == 0;
                vfy->no_fsck = strcmp(realtype, "xfs") == 0
                                || strcmp(realtype, "btrfs") == 0;
 
+               /* libblkid always reports "ntfs"; remap possible different
+                * names from fstab to "ntfs" as well */
+               if (type && strcmp(type, "ntfs3") == 0)
+                       type = "ntfs";
+
                if (type && !isauto && strcmp(type, realtype) != 0) {
                        verify_warn(vfy, _("%s does not match with on-disk %s"), type, realtype);
                        goto done;
                }
-               if (!isswap && !is_supported_filesystem(vfy, realtype)) {
-                       verify_warn(vfy, _("on-disk %s seems unsupported by the current kernel"), realtype);
+
+               mounttype = ul_fstype_to_mounttype(realtype) ? : realtype;
+
+               if (!isswap
+                   && (!type || isauto)
+                   && !is_supported_filesystem(vfy, mounttype)) {
+                       verify_warn(vfy, _("on-disk %s seems unsupported by the current kernel"), mounttype);
                        goto done;
                }