From: Mikhail Pershin Date: Thu, 20 Jul 2023 10:27:59 +0000 (+0300) Subject: EX-3860 llog: extended debug for -ENOTDIR error X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=00548f792af9e7efdccc2e9fe0162f188c524e18;p=fs%2Flustre-release.git EX-3860 llog: extended debug for -ENOTDIR error Debug patch to catch trace and debug log for -ENOTDIR error in distribute_txn_cancel_records() Signed-off-by: Mikhail Pershin Change-Id: Ie1bb7c138282bfa05a2fafcceafdb436d45f28d3 Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52394 Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index ed130cc..d79d00e 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -190,10 +190,10 @@ int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj, bool check) { if (check) { if (unlikely(!dt_object_exists(obj))) - return 0; + RETURN(0); if (unlikely(!S_ISDIR(lu_object_attr(&obj->do_lu)))) - return 0; + RETURN(0); if (obj->do_index_ops) return 1; @@ -201,6 +201,7 @@ int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj, bool check) obj->do_ops->do_index_try(env, obj, &dt_directory_features); + EXIT; return obj->do_index_ops != NULL; } EXPORT_SYMBOL(dt_try_as_dir); diff --git a/lustre/target/update_trans.c b/lustre/target/update_trans.c index 16acc80..c8dae80 100644 --- a/lustre/target/update_trans.c +++ b/lustre/target/update_trans.c @@ -1281,6 +1281,9 @@ static int distribute_txn_cancel_records(const struct lu_env *env, struct top_multiple_thandle *tmt) { struct sub_thandle *st; + unsigned int debug = 0; + bool debug_done = false; + ENTRY; if (OBD_FAIL_CHECK(OBD_FAIL_TGT_TXN_NO_CANCEL)) @@ -1303,15 +1306,29 @@ static int distribute_txn_cancel_records(const struct lu_env *env, cookie = &stc->stc_cookie; if (fid_is_zero(&cookie->lgc_lgl.lgl_oi.oi_fid)) continue; - +do_debug_run: rc = llog_cat_cancel_records(env, ctxt->loc_handle, 1, cookie); CDEBUG(D_HA, "%s: batchid %llu cancel update log " DFID".%u: rc = %d\n", obd->obd_name, tmt->tmt_batchid, PLOGID(&cookie->lgc_lgl), cookie->lgc_index, rc); + if (unlikely(rc == -ENOTDIR && !debug_done)) { + if (!debug) { + debug = libcfs_debug; + libcfs_debug |= D_TRACE | D_INFO | + D_OTHER | D_INODE | + D_RPCTRACE; + goto do_debug_run; + } else { + libcfs_debug = debug; + libcfs_debug_dumplog(); + debug_done = true; + } + } } - + if (unlikely(debug && !debug_done)) + libcfs_debug = debug; llog_ctxt_put(ctxt); }