Blame SOURCES/0024-findmnt-verify-ignore-passno-for-XFS.patch

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