From d59d553dc18189dfc5e43196f7c8a2bd6346b675 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Mon, 30 May 2016 22:55:06 +0900 Subject: [PATCH] LU-8216 ldiskfs: fix journal quota files When we hit Lustre crash, e2fsck will always complains Quota accounting mismatch, and sometimes differences are huge. Problems are we don't journal quota updates properly, and with current codes quota files will be only journaled when syncing filesystem, that only happen by sync call or unmounting. Signed-off-by: Wang Shilong Change-Id: I94c148a6b48f2464e96320bbadc88a3c234eacb0 Reviewed-on: http://review.whamcloud.com/20503 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Yang Sheng --- .../patches/rhel6.5/ext4-fix-journal-quota.patch | 15 +++++++++++++++ ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series | 1 + ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series | 1 + ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.7.series | 1 + ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series | 1 + ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series | 1 + .../kernel_patches/series/ldiskfs-3.0-sles11sp3.series | 1 + 7 files changed, 21 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/rhel6.5/ext4-fix-journal-quota.patch diff --git a/ldiskfs/kernel_patches/patches/rhel6.5/ext4-fix-journal-quota.patch b/ldiskfs/kernel_patches/patches/rhel6.5/ext4-fix-journal-quota.patch new file mode 100644 index 0000000..220de39 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/rhel6.5/ext4-fix-journal-quota.patch @@ -0,0 +1,15 @@ +diff --git a/fs/ext4/super.c b/fs/ext4/super.c +index 1ed737f..77e2fb3 100644 +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -4672,7 +4672,9 @@ static int ext4_release_dquot(struct dquot *dquot) + static int ext4_mark_dquot_dirty(struct dquot *dquot) + { + /* Are we journaling quotas? */ +- if (EXT4_SB(dquot->dq_sb)->s_qf_names[USRQUOTA] || ++ if (EXT4_HAS_RO_COMPAT_FEATURE(dquot->dq_sb, ++ EXT4_FEATURE_RO_COMPAT_QUOTA) || ++ EXT4_SB(dquot->dq_sb)->s_qf_names[USRQUOTA] || + EXT4_SB(dquot->dq_sb)->s_qf_names[GRPQUOTA]) { + dquot_mark_dquot_dirty(dquot); + return ext4_write_dquot(dquot); diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series index 0881a7a..d656b85 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series @@ -46,3 +46,4 @@ rhel6.3/ext4-journal-path-opt.patch rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch rhel6.3/ext4-notalloc_under_idatasem.patch rhel6.5/ext4-give-warning-with-dir-htree-growing.patch +rhel6.5/ext4-fix-journal-quota.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series index 9405d7e..e6fae81 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series @@ -48,3 +48,4 @@ rhel6.6/ext4-corrupted-inode-block-bitmaps-handling-patches.patch rhel6.3/ext4-notalloc_under_idatasem.patch rhel6.5/ext4-give-warning-with-dir-htree-growing.patch rhel6.6/ext4_s_max_ext_tree_depth.patch +rhel6.5/ext4-fix-journal-quota.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.7.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.7.series index bea14bc..c25d944 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.7.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.7.series @@ -47,3 +47,4 @@ rhel6.6/ext4-corrupted-inode-block-bitmaps-handling-patches.patch rhel6.3/ext4-notalloc_under_idatasem.patch rhel6.5/ext4-give-warning-with-dir-htree-growing.patch rhel6.6/ext4_s_max_ext_tree_depth.patch +rhel6.5/ext4-fix-journal-quota.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series index f3a9d2f..ffffacc 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series @@ -42,3 +42,4 @@ rhel6.3/ext4-not-discard-preallocation-umount.patch rhel6.3/ext4-journal-path-opt.patch rhel6.3/ext4-recalc-percpu-counters-after-journal.patch rhel6.3/ext4-notalloc_under_idatasem.patch +rhel6.5/ext4-fix-journal-quota.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series index 04f38fc..dc96ece 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series @@ -39,3 +39,4 @@ rhel6.3/ext4-not-discard-preallocation-umount.patch rhel6.3/ext4-journal-path-opt.patch sles11sp3/ext4_s_max_ext_tree_depth.patch sles11sp1/ext4-notalloc_under_idatasem.patch +rhel6.5/ext4-fix-journal-quota.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series index 37a8845..7806d12 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series @@ -41,3 +41,4 @@ rhel6.5/ext4-give-warning-with-dir-htree-growing.patch sles11sp3/ext4-mmp-brelse.patch sles11sp3/ext4_s_max_ext_tree_depth.patch sles11sp1/ext4-notalloc_under_idatasem.patch +rhel6.5/ext4-fix-journal-quota.patch -- 1.8.3.1