]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: (verify) ignore passno for btrfs
authorKarel Zak <kzak@redhat.com>
Fri, 21 Jan 2022 11:10:44 +0000 (12:10 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 21 Jan 2022 11:10:44 +0000 (12:10 +0100)
 "Traditional filesystems need to run their respective fsck utility in case
 the filesystem was not unmounted cleanly and the log needs to be replayed
 before mount. This is not needed for btrfs. You should set fs_passno to 0."

 https://btrfs.wiki.kernel.org/index.php/FAQ#When_will_Btrfs_have_a_fsck_like_tool.3F"

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

index 1577aa993759142094eb3422ab86ef5e59c87902..624c7205e832168272e4b95e707dfa31f239c655 100644 (file)
@@ -437,7 +437,7 @@ static int verify_fstype(struct verify_context *vfy)
                        isauto = 1;
                else if (strcmp(type, "swap") == 0)
                        isswap = 1;
-               else if (strcmp(type, "xfs") == 0)
+               else if (strcmp(type, "xfs") == 0 || strcmp(type, "btrfs") == 0)
                        vfy->no_fsck = 1;
 
                if (!isswap && !isauto && !none && !is_supported_filesystem(vfy, type))
@@ -455,7 +455,8 @@ static int verify_fstype(struct verify_context *vfy)
 
        if (realtype) {
                isswap = strcmp(realtype, "swap") == 0;
-               vfy->no_fsck = strcmp(realtype, "xfs") == 0;
+               vfy->no_fsck = strcmp(realtype, "xfs") == 0
+                               || strcmp(realtype, "btrfs") == 0;
 
                if (type && !isauto && strcmp(type, realtype) != 0) {
                        verify_err(vfy, _("%s does not match with on-disk %s"), type, realtype);