lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141107215303.883.11462.stgit@birch.djwong.org>
Date:	Fri, 07 Nov 2014 13:53:03 -0800
From:	"Darrick J. Wong" <darrick.wong@...cle.com>
To:	tytso@....edu, darrick.wong@...cle.com
Cc:	linux-ext4@...r.kernel.org
Subject: [PATCH 21/47] tune2fs: enable uninit_bg when disabling metadata_csum

If we're disabling metadata_csum and the user doesn't provide explicit
instructions to enable or disable uninit_bg, assume that they want
uninit_bg to be turned on by default.  Otherwise, we lose all block
group flags and unused inode count, which is a big hit to performance.

Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
---
 misc/tune2fs.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)


diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 6feaab1..1c83d09 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1141,12 +1141,26 @@ mmp_error:
 
 	if (FEATURE_OFF(E2P_FEATURE_RO_INCOMPAT,
 			EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) {
+		__u32	test_features[3];
+
 		if (check_fsck_needed(fs))
 			exit(1);
 		if (mount_flags & EXT2_MF_MOUNTED)
 			fputs(_("Cannot disable metadata_csum on a mounted "
 				"filesystem!\n"), stderr);
 		rewrite_checksums = 1;
+
+		/* Enable uninit_bg unless the user expressly turned it off */
+		memcpy(test_features, old_features, sizeof(test_features));
+		test_features[E2P_FEATURE_RO_INCOMPAT] |=
+						EXT4_FEATURE_RO_COMPAT_GDT_CSUM;
+		e2p_edit_feature2(features, test_features, ok_features,
+				  clear_ok_features, NULL, NULL);
+		if (test_features[E2P_FEATURE_RO_INCOMPAT] &
+						EXT4_FEATURE_RO_COMPAT_GDT_CSUM)
+			fs->super->s_feature_ro_compat |=
+						EXT4_FEATURE_RO_COMPAT_GDT_CSUM;
+
 		/*
 		 * If we're turning off metadata_csum and not turning on
 		 * uninit_bg, rewrite group desc.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ