From fb55704fbd6e1a9b97c830ee8c51813b945fa778 Mon Sep 17 00:00:00 2001 From: Alexey Lyashkov Date: Fri, 9 Aug 2024 11:33:42 +0300 Subject: [PATCH] LU-18120 ldiskfs: improve a quota speedup patch current patch might have a small window to make write duplicate, lets avoid it. HPe-bug-id: LUS-12432 Signed-off-by: Alexey Lyashkov Change-Id: I8de2e675d3bf5d5cbb41b25b04affe1d5e0d6411 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55979 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andrew Perepechko Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- .../patches/rhel7.6/ext4-dquot-commit-speedup.patch | 15 +++++++++------ .../patches/rhel9/ext4-dquot-commit-speedup.patch | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ldiskfs/kernel_patches/patches/rhel7.6/ext4-dquot-commit-speedup.patch b/ldiskfs/kernel_patches/patches/rhel7.6/ext4-dquot-commit-speedup.patch index 2b32630..ca53ebd 100644 --- a/ldiskfs/kernel_patches/patches/rhel7.6/ext4-dquot-commit-speedup.patch +++ b/ldiskfs/kernel_patches/patches/rhel7.6/ext4-dquot-commit-speedup.patch @@ -1,11 +1,14 @@ ---- a/fs/ext4/super.c 2018-07-11 16:27:46.890341960 +0300 -+++ b/fs/ext4/super.c 2018-07-11 16:29:17.549061853 +0300 -@@ -5403,6 +5403,8 @@ static int ext4_mark_dquot_dirty(struct +Index: linux-stage/fs/ext4/super.c +=================================================================== +--- linux-stage.orig/fs/ext4/super.c ++++ linux-stage/fs/ext4/super.c +@@ -5795,7 +5795,8 @@ static int ext4_mark_dquot_dirty(struct /* Are we journaling quotas? */ - if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA) || + if (ext4_has_feature_quota(sb) || sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) { -+ if (test_bit(DQ_MOD_B, &dquot->dq_flags)) +- dquot_mark_dquot_dirty(dquot); ++ if (dquot_mark_dquot_dirty(dquot)) + return 0; - dquot_mark_dquot_dirty(dquot); return ext4_write_dquot(dquot); } else { + return dquot_mark_dquot_dirty(dquot); diff --git a/ldiskfs/kernel_patches/patches/rhel9/ext4-dquot-commit-speedup.patch b/ldiskfs/kernel_patches/patches/rhel9/ext4-dquot-commit-speedup.patch index 3db463a..04a5f69 100644 --- a/ldiskfs/kernel_patches/patches/rhel9/ext4-dquot-commit-speedup.patch +++ b/ldiskfs/kernel_patches/patches/rhel9/ext4-dquot-commit-speedup.patch @@ -1,11 +1,11 @@ --- a/fs/ext4/super.c 2023-05-12 10:38:47.356662467 -0700 +++ b/fs/ext4/super.c 2023-05-12 10:42:30.325161896 -0700 -@@ -6739,6 +6739,8 @@ static int ext4_mark_dquot_dirty(struct +@@ -6739,6 +6739,7 @@ static int ext4_mark_dquot_dirty(struct struct super_block *sb = dquot->dq_sb; if (ext4_is_quota_journalled(sb)) { -+ if (test_bit(DQ_MOD_B, &dquot->dq_flags)) +- dquot_mark_dquot_dirty(dquot); ++ if (dquot_mark_dquot_dirty(dquot)) + return 0; - dquot_mark_dquot_dirty(dquot); return ext4_write_dquot(dquot); } else { -- 1.8.3.1