Whamcloud - gitweb
LU-8216 ldiskfs: fix journal quota files 03/20503/3
authorWang Shilong <wshilong@ddn.com>
Mon, 30 May 2016 13:55:06 +0000 (22:55 +0900)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 14 Jun 2016 03:49:09 +0000 (03:49 +0000)
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 <wshilong@ddn.com>
Change-Id: I94c148a6b48f2464e96320bbadc88a3c234eacb0
Reviewed-on: http://review.whamcloud.com/20503
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
ldiskfs/kernel_patches/patches/rhel6.5/ext4-fix-journal-quota.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.7.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series
ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series
ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series

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 (file)
index 0000000..220de39
--- /dev/null
@@ -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);
index 0881a7a..d656b85 100644 (file)
@@ -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
index 9405d7e..e6fae81 100644 (file)
@@ -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
index bea14bc..c25d944 100644 (file)
@@ -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
index f3a9d2f..ffffacc 100644 (file)
@@ -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
index 04f38fc..dc96ece 100644 (file)
@@ -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
index 37a8845..7806d12 100644 (file)
@@ -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