cdown / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
22a545
From 3f6de92999cf63e234265f51d6ee02134bc75ac3 Mon Sep 17 00:00:00 2001
22a545
From: Karel Zak <kzak@redhat.com>
22a545
Date: Wed, 12 Jun 2019 11:02:51 +0200
22a545
Subject: [PATCH 24/24] findmnt: (verify) ignore passno for XFS
22a545
22a545
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1719069
22a545
Upstream: http://github.com/karelzak/util-linux/commit/f5b7bf155b9881de5b99cc0a23b4dccf9a2d4af3
22a545
Signed-off-by: Karel Zak <kzak@redhat.com>
22a545
---
22a545
 misc-utils/findmnt-verify.c | 12 +++++++++---
22a545
 1 file changed, 9 insertions(+), 3 deletions(-)
22a545
22a545
diff --git a/misc-utils/findmnt-verify.c b/misc-utils/findmnt-verify.c
22a545
index 1cc62def9..73e44a418 100644
22a545
--- a/misc-utils/findmnt-verify.c
22a545
+++ b/misc-utils/findmnt-verify.c
22a545
@@ -28,7 +28,8 @@ struct verify_context {
22a545
 	int	nwarnings;
22a545
 	int	nerrors;
22a545
 
22a545
-	unsigned int	target_printed : 1;
22a545
+	unsigned int	target_printed : 1,
22a545
+			no_fsck : 1;
22a545
 };
22a545
 
22a545
 static void verify_mesg(struct verify_context *vfy, char type, const char *fmt, va_list ap)
22a545
@@ -408,6 +409,8 @@ static int verify_fstype(struct verify_context *vfy)
22a545
 			isauto = 1;
22a545
 		else if (strcmp(type, "swap") == 0)
22a545
 			isswap = 1;
22a545
+		else if (strcmp(type, "xfs") == 0)
22a545
+			vfy->no_fsck = 1;
22a545
 
22a545
 		if (!isswap && !isauto && !none && !is_supported_filesystem(vfy, type))
22a545
 			verify_warn(vfy, _("%s seems unsupported by the current kernel"), type);
22a545
@@ -422,6 +425,7 @@ static int verify_fstype(struct verify_context *vfy)
22a545
 
22a545
 	if (realtype) {
22a545
 		isswap = strcmp(realtype, "swap") == 0;
22a545
+		vfy->no_fsck = strcmp(realtype, "xfs") == 0;
22a545
 
22a545
 		if (type && !isauto && strcmp(type, realtype) != 0)
22a545
 			return verify_err(vfy, _("%s does not match with on-disk %s"), type, realtype);
22a545
@@ -440,7 +444,7 @@ static int verify_passno(struct verify_context *vfy)
22a545
 	int passno = mnt_fs_get_passno(vfy->fs);
22a545
 	const char *tgt = mnt_fs_get_target(vfy->fs);
22a545
 
22a545
-	if (tgt && strcmp("/", tgt) == 0 && passno != 1)
22a545
+	if (tgt && strcmp("/", tgt) == 0 && passno != 1 && !vfy->no_fsck)
22a545
 		return verify_warn(vfy, _("recommended root FS passno is 1 (current is %d)"), passno);
22a545
 
22a545
 	return 0;
22a545
@@ -463,7 +467,7 @@ static int verify_filesystem(struct verify_context *vfy)
22a545
 	if (!rc)
22a545
 		rc = verify_fstype(vfy);
22a545
 	if (!rc)
22a545
-		rc = verify_passno(vfy);
22a545
+		rc = verify_passno(vfy);	/* depends on verify_fstype() */
22a545
 
22a545
 	return rc;
22a545
 }
22a545
@@ -492,6 +496,8 @@ int verify_table(struct libmnt_table *tb)
22a545
 
22a545
 	while (rc == 0 && (vfy.fs = get_next_fs(tb, itr))) {
22a545
 		vfy.target_printed = 0;
22a545
+		vfy.no_fsck = 0;
22a545
+
22a545
 		if (check_order)
22a545
 			rc = verify_order(&vfy;;
22a545
 		if (!rc)
22a545
-- 
22a545
2.21.0
22a545