Whamcloud - gitweb
LU-17010 lfsck: don't dump stack repeatedly 53/54853/2
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 13 Sep 2023 05:12:18 +0000 (23:12 -0600)
committerOleg Drokin <green@whamcloud.com>
Sat, 4 May 2024 03:01:28 +0000 (03:01 +0000)
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.

Lustre-commit: dc360cd3eff20618f243ab89097a62f8ecf2c929
Lustre-change: https://review.whamcloud.com/52356

Test-Parameters: trivial testlist=sanity-lfsck
Fixes: 0c1ae1cb9c ("LU-13124 scrub: check for multiple linked file")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I0b0d64911453dc8ab947e284656311b5d0300c1e
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54853
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/lfsck/lfsck_internal.h

index e6a8a48..8e048e7 100644 (file)
@@ -1549,10 +1549,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);
        }