From b09a597098943b8f0f990984143a70a46ac41632 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 4 Oct 2018 21:36:10 -0500 Subject: [PATCH] xfs: force summary counter recalc at next mount Source kernel commit: f467cad95f5e3814fda408dea76eb962ab19685d Use the "bad summary count" mount flag from the previous patch to skip writing the unmount record to force log recovery at the next mount, which will recalculate the summary counters for us. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- io/inject.c | 6 +++++- libxfs/xfs_errortag.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/io/inject.c b/io/inject.c index 54913cce2..2061c9577 100644 --- a/io/inject.c +++ b/io/inject.c @@ -52,11 +52,15 @@ error_tag(char *name) { XFS_ERRTAG_LOG_ITEM_PIN, "log_item_pin" }, { XFS_ERRTAG_BUF_LRU_REF, "buf_lru_ref" }, { XFS_ERRTAG_FORCE_SCRUB_REPAIR, "force_repair" }, + { XFS_ERRTAG_FORCE_SUMMARY_RECALC, "bad_summary" }, { XFS_ERRTAG_MAX, NULL } }; int count; - /* If this fails make sure every tag is defined in the array above */ + /* + * If this fails make sure every tag is defined in the array above, + * see xfs_errortag_attrs in kernelspace. + */ BUILD_BUG_ON(sizeof(eflags) != (XFS_ERRTAG_MAX + 1) * sizeof(*e)); /* Search for a name */ diff --git a/libxfs/xfs_errortag.h b/libxfs/xfs_errortag.h index b9974e7a8..66077a105 100644 --- a/libxfs/xfs_errortag.h +++ b/libxfs/xfs_errortag.h @@ -53,7 +53,8 @@ #define XFS_ERRTAG_LOG_ITEM_PIN 30 #define XFS_ERRTAG_BUF_LRU_REF 31 #define XFS_ERRTAG_FORCE_SCRUB_REPAIR 32 -#define XFS_ERRTAG_MAX 33 +#define XFS_ERRTAG_FORCE_SUMMARY_RECALC 33 +#define XFS_ERRTAG_MAX 34 /* * Random factors for above tags, 1 means always, 2 means 1/2 time, etc. @@ -91,5 +92,6 @@ #define XFS_RANDOM_LOG_ITEM_PIN 1 #define XFS_RANDOM_BUF_LRU_REF 2 #define XFS_RANDOM_FORCE_SCRUB_REPAIR 1 +#define XFS_RANDOM_FORCE_SUMMARY_RECALC 1 #endif /* __XFS_ERRORTAG_H_ */ -- 2.47.2