From dc360cd3eff20618f243ab89097a62f8ecf2c929 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 12 Sep 2023 23:12:18 -0600 Subject: [PATCH] LU-17010 lfsck: don't dump stack repeatedly If there are transactions started with LFSCK in dry-run mode, don't dump the stack repeatedly, as this can spam the console logs and significantly hurt performance. Test-Parameters: trivial testlist=sanity-lfsck Fixes: 0c1ae1cb9c ("LU-13124 scrub: check for multiple linked file") Signed-off-by: Andreas Dilger Change-Id: I0b0d64911453dc8ab947e284656311b5d0300c1e Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52356 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Hongchao Zhang Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- lustre/lfsck/lfsck_internal.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/lfsck/lfsck_internal.h b/lustre/lfsck/lfsck_internal.h index cffe2c7..7330b0d 100644 --- a/lustre/lfsck/lfsck_internal.h +++ b/lustre/lfsck/lfsck_internal.h @@ -1551,10 +1551,13 @@ lfsck_trans_create(const struct lu_env *env, struct dt_device *dev, struct lfsck_instance *lfsck) { if (lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN) { + static int count; + CERROR("%s: transaction is being created in DRYRUN mode!\n", lfsck_lfsck2name(lfsck)); - dump_stack(); + if (count++ < 3) + dump_stack(); return ERR_PTR(-EINVAL); } -- 1.8.3.1