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: <20140908231208.25904.32508.stgit@birch.djwong.org>
Date:	Mon, 08 Sep 2014 16:12:08 -0700
From:	"Darrick J. Wong" <darrick.wong@...cle.com>
To:	tytso@....edu, darrick.wong@...cle.com
Cc:	linux-ext4@...r.kernel.org, TR Reardon <thomas_reardon@...mail.com>
Subject: [PATCH 05/25] mke2fs: allow creation of journal device with
 superblock checksum

Enable mke2fs to create an external journal device with a superblock
checksum.

Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
Cc: TR Reardon <thomas_reardon@...mail.com>
---
 misc/mke2fs.c                   |    6 +++++-
 tests/m_mcsum_extjournal/expect |    5 +++++
 tests/m_mcsum_extjournal/name   |    1 +
 tests/m_mcsum_extjournal/script |   29 +++++++++++++++++++++++++++++
 4 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 tests/m_mcsum_extjournal/expect
 create mode 100644 tests/m_mcsum_extjournal/name
 create mode 100644 tests/m_mcsum_extjournal/script


diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index fc03766..2bc435b 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2124,7 +2124,8 @@ profile_error:
 		reserved_ratio = 0;
 		fs_param.s_feature_incompat = EXT3_FEATURE_INCOMPAT_JOURNAL_DEV;
 		fs_param.s_feature_compat = 0;
-		fs_param.s_feature_ro_compat = 0;
+		fs_param.s_feature_ro_compat &=
+					EXT4_FEATURE_RO_COMPAT_METADATA_CSUM;
  	}
 
 	/* Check the user's mkfs options for 64bit */
@@ -2743,6 +2744,8 @@ int main (int argc, char *argv[])
 
 	/* Check the user's mkfs options for metadata checksumming */
 	if (!quiet &&
+	    !EXT2_HAS_INCOMPAT_FEATURE(fs->super,
+				       EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) &&
 	    EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
 				       EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) {
 		if (!EXT2_HAS_INCOMPAT_FEATURE(fs->super,
@@ -2909,6 +2912,7 @@ int main (int argc, char *argv[])
 	if (fs->super->s_feature_incompat &
 	    EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
 		create_journal_dev(fs);
+		printf("\n");
 		exit(ext2fs_close_free(&fs) ? 1 : 0);
 	}
 
diff --git a/tests/m_mcsum_extjournal/expect b/tests/m_mcsum_extjournal/expect
new file mode 100644
index 0000000..ef895f8
--- /dev/null
+++ b/tests/m_mcsum_extjournal/expect
@@ -0,0 +1,5 @@
+Creating filesystem with 4096 1k blocks and 0 inodes
+Superblock backups stored on blocks: 
+
+Zeroing journal device:          .........
+Filesystem features:      journal_dev metadata_csum
diff --git a/tests/m_mcsum_extjournal/name b/tests/m_mcsum_extjournal/name
new file mode 100644
index 0000000..7df8389
--- /dev/null
+++ b/tests/m_mcsum_extjournal/name
@@ -0,0 +1 @@
+create external journal with sb checksum (metadata_csum)
diff --git a/tests/m_mcsum_extjournal/script b/tests/m_mcsum_extjournal/script
new file mode 100644
index 0000000..624bf02
--- /dev/null
+++ b/tests/m_mcsum_extjournal/script
@@ -0,0 +1,29 @@
+FSCK_OPT=-fy
+OUT=$test_name.log
+if [ -f $test_dir/expect.gz ]; then
+	EXP=$test_name.tmp
+	gunzip < $test_dir/expect.gz > $EXP1
+else
+	EXP=$test_dir/expect
+fi
+
+cp /dev/null $OUT
+
+$MKE2FS -F -o Linux -b 1024 -O journal_dev,metadata_csum -T ext4 $TMPFILE 4096 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT 2>&1
+$DUMPE2FS -h $TMPFILE 2>&1 | grep 'Filesystem features:' >> $OUT
+
+rm -f $TMPFILE
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+	echo "$test_name: $test_description: ok"
+	touch $test_name.ok
+else
+	echo "$test_name: $test_description: failed"
+	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+	rm -f $test_name.tmp
+fi
+
+unset IMAGE FSCK_OPT OUT EXP

--
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