Viewing: ext4-dquot-commit-speedup.patch

commit dad25f258e50895b4bd5fce30765599a7a490aa0
Author:     Andrew Perepechko <andrew.perepechko@hpe.com>
AuthorDate: Wed Jul 11 16:32:33 2018 +0300
LU-12353 ldiskfs: speedup quota journalling

ldiskfs_mark_dquot_dirty() need not call
ldiskfs_write_dquot() if the dquot is already
dirty since we are guaranteed that another
thread is already writing the dquot and
will update the buffer with the latest
dquot data.

Signed-off-by: Andrew Perepechko <c17827@cray.com>
Cray-bug-id: LUS-5342
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ia65c5987bbb0d6d2ac94c5499cb8b51edc3c49c3
Reviewed-on: https://review.whamcloud.com/34992

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_feature_quota(sb) ||
 	    sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
-		dquot_mark_dquot_dirty(dquot);
+		if (dquot_mark_dquot_dirty(dquot))
+			return 0;
 		return ext4_write_dquot(dquot);
 	} else {
 		return dquot_mark_dquot_dirty(dquot);