]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: (verify) add options verification
authorKarel Zak <kzak@redhat.com>
Wed, 21 Sep 2016 12:32:47 +0000 (14:32 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 23 Sep 2016 11:21:02 +0000 (13:21 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/findmnt-verify.c

index 547703ca82b827c913c5c9a1a9c5399d8b2a8780..52bf8518b1cb3ec836aad19136d769d14ddb1179 100644 (file)
@@ -216,12 +216,34 @@ done:
        return 0;
 }
 
+static int verify_options(struct verify_context *vfy)
+{
+       const char *opts;
+
+       opts = mnt_fs_get_vfs_options(vfy->fs);
+       if (opts)
+               verify_ok(vfy, _("VFS options: %s"), opts);
+
+       opts = mnt_fs_get_fs_options(vfy->fs);
+       if (opts)
+               verify_ok(vfy, _("FS options: %s"), opts);
+
+       opts = mnt_fs_get_user_options(vfy->fs);
+       if (opts)
+               verify_ok(vfy, _("userspace options: %s"), opts);
+
+       return 0;
+}
+
 static int verify_filesystem(struct verify_context *vfy)
 {
        int rc = 0;
 
-       if (!mnt_fs_is_swaparea(vfy->fs))
+       if (!mnt_fs_is_swaparea(vfy->fs)) {
                rc = verify_target(vfy);
+               if (!rc)
+                       rc = verify_options(vfy);
+       }
        if (!rc)
                verify_source(vfy);