From 17cf1f5fab2950a2990b9bdd69866c201c924fcd Mon Sep 17 00:00:00 2001 From: girish Date: Mon, 20 Aug 2007 12:36:09 +0000 Subject: [PATCH] Add journal checksum feature. b=10657 i=adilger i=kalpak --- ldiskfs/ChangeLog | 13 ++++ .../ext3-journal-chksum-2.6.18-vanilla.patch | 81 ++++++++++++++++++++++ .../series/ldiskfs-2.6-sles10.series | 1 + .../series/ldiskfs-2.6.18-vanilla.series | 1 + 4 files changed, 96 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/ext3-journal-chksum-2.6.18-vanilla.patch diff --git a/ldiskfs/ChangeLog b/ldiskfs/ChangeLog index 1e27cea..9bd9d6b 100644 --- a/ldiskfs/ChangeLog +++ b/ldiskfs/ChangeLog @@ -8,3 +8,16 @@ Bugzilla : 12415 Description: Updated patchess for new RHEL4 kernel Details : Add patch ext3-unlink-race.patch Updated series file ldiskfs-2.6-rhel4.series + +Severity : normal +Bugzilla : 10657 +Description: Add journal checksum support. (ext3 part) +Details : The journal checksum feature adds two new flags i.e + JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT and + JBD2_FEATURE_COMPAT_CHECKSUM. JBD2_FEATURE_CHECKSUM flag + indicates that the commit block contains the checksum for + the blocks described by the descriptor blocks. Now commit + record can be sent to disk without waiting for descriptor + blocks to be written to disk. This behavior is controlled + using JBD2_FEATURE_ASYNC_COMMIT flag. + diff --git a/ldiskfs/kernel_patches/patches/ext3-journal-chksum-2.6.18-vanilla.patch b/ldiskfs/kernel_patches/patches/ext3-journal-chksum-2.6.18-vanilla.patch new file mode 100644 index 0000000..1d8f299 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-journal-chksum-2.6.18-vanilla.patch @@ -0,0 +1,81 @@ +Index: linux-2.6.18/fs/ext3/super.c +=================================================================== +--- linux-2.6.18.orig/fs/ext3/super.c ++++ linux-2.6.18/fs/ext3/super.c +@@ -688,6 +688,9 @@ enum { + Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, + Opt_reservation, Opt_noreservation, Opt_noload, Opt_nobh, Opt_bh, + Opt_commit, Opt_journal_update, Opt_journal_inum, Opt_journal_dev, ++#ifdef JFS_FEATURE_COMPAT_CHECKSUM ++ Opt_journal_checksum, Opt_journal_async_commit, ++#endif + Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, + Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, + Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, +@@ -730,6 +733,10 @@ static match_table_t tokens = { + {Opt_journal_update, "journal=update"}, + {Opt_journal_inum, "journal=%u"}, + {Opt_journal_dev, "journal_dev=%u"}, ++#ifdef JFS_FEATURE_COMPAT_CHECKSUM ++ {Opt_journal_checksum, "journal_checksum"}, ++ {Opt_journal_async_commit, "journal_async_commit"}, ++#endif + {Opt_abort, "abort"}, + {Opt_data_journal, "data=journal"}, + {Opt_data_ordered, "data=ordered"}, +@@ -924,6 +931,15 @@ static int parse_options (char *options, + return 0; + *journal_devnum = option; + break; ++#ifdef JFS_FEATURE_COMPAT_CHECKSUM ++ case Opt_journal_checksum: ++ set_opt (sbi->s_mount_opt, JOURNAL_CHECKSUM); ++ break; ++ case Opt_journal_async_commit: ++ set_opt (sbi->s_mount_opt, JOURNAL_ASYNC_COMMIT); ++ set_opt (sbi->s_mount_opt, JOURNAL_CHECKSUM); ++ break; ++#endif + case Opt_noload: + set_opt (sbi->s_mount_opt, NOLOAD); + break; +@@ -2180,6 +2196,23 @@ static int ext3_fill_super (struct super + goto failed_mount3; + } + ++#ifdef JFS_FEATURE_COMPAT_CHECKSUM ++ if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) { ++ journal_set_features(sbi->s_journal, ++ JFS_FEATURE_COMPAT_CHECKSUM, 0, ++ JFS_FEATURE_INCOMPAT_ASYNC_COMMIT); ++ } else if (test_opt(sb, JOURNAL_CHECKSUM)) { ++ journal_set_features(sbi->s_journal, ++ JFS_FEATURE_COMPAT_CHECKSUM, 0, 0); ++ journal_clear_features(sbi->s_journal, 0, 0, ++ JFS_FEATURE_INCOMPAT_ASYNC_COMMIT); ++ } else { ++ journal_clear_features(sbi->s_journal, ++ JFS_FEATURE_COMPAT_CHECKSUM, 0, ++ JFS_FEATURE_INCOMPAT_ASYNC_COMMIT); ++ } ++#endif ++ + /* We have now updated the journal if required, so we can + * validate the data journaling mode. */ + switch (test_opt(sb, DATA_FLAGS)) { +Index: linux-2.6.18/include/linux/ext3_fs.h +=================================================================== +--- linux-2.6.18.orig/include/linux/ext3_fs.h ++++ linux-2.6.18/include/linux/ext3_fs.h +@@ -476,6 +476,11 @@ do { \ + #define EXT3_MOUNT_EXTDEBUG 0x4000000/* Extents debug */ + #define EXT3_MOUNT_MBALLOC 0x8000000/* Buddy allocation support */ + ++#ifdef JFS_FEATURE_COMPAT_CHECKSUM ++#define EXT3_MOUNT_JOURNAL_CHECKSUM 0x10000000 /* Journal checksums */ ++#define EXT3_MOUNT_JOURNAL_ASYNC_COMMIT 0x20000000 /* Journal Async Commit */ ++#endif ++ + /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ + #ifndef clear_opt + #define clear_opt(o, opt) o &= ~EXT3_MOUNT_##opt diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series index 04768bd..f62b9eb 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series @@ -18,3 +18,4 @@ ext3-disable-write-bar-by-default-2.6-sles10.patch ext3-uninit-2.6-sles10.patch ext3-nanosecond-2.6-sles10.patch ext3-inode-version-2.6-sles10.patch +ext3-journal-chksum-2.6.18-vanilla.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6.18-vanilla.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6.18-vanilla.series index 3fc9e90..4afc5d4 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6.18-vanilla.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6.18-vanilla.series @@ -13,3 +13,4 @@ ext3-filterdata-sles10.patch ext3-uninit-2.6.18.patch ext3-nanosecond-2.6.18-vanilla.patch ext3-inode-version-2.6.18-vanilla.patch +ext3-journal-chksum-2.6.18-vanilla.patch -- 1.8.3.1