From 080f1d1ca7332e37e6139732b24dba08723b1312 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Sat, 18 May 2024 22:43:05 +0300 Subject: [PATCH] EX-9183 llog: debug for llog cancel problems - add debug messages for update_log_dir remote access errors - remove former extended debug for -ENOTDIR error Fixes: 00548f792a ("EX-3860 llog: extended debug for -ENOTDIR error") Signed-off-by: Mikhail Pershin Change-Id: Ifb87489cc76f10814eb12eba0a4ae997293fa11d Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55389 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/obdclass/dt_object.c | 5 ++--- lustre/target/out_handler.c | 24 ++++++++++++++++-------- lustre/target/update_trans.c | 21 ++------------------- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index d4760f6..ed6b009 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,7 +201,6 @@ 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/out_handler.c b/lustre/target/out_handler.c index 339b2c8..d951e59 100644 --- a/lustre/target/out_handler.c +++ b/lustre/target/out_handler.c @@ -192,12 +192,16 @@ static int out_attr_get(struct tgt_session_info *tsi) struct dt_object *obj = tti->tti_u.update.tti_dt_object; int idx = tti->tti_u.update.tti_update_reply_index; int rc; + int level = D_INFO; ENTRY; if (unlikely(update->ou_result_size < sizeof(*obdo))) return -EPROTO; + if (fid_is_update_log_dir(lu_object_fid(&obj->do_lu))) + level = D_WARNING; + if (!lu_object_exists(&obj->do_lu)) { /* Usually, this will be called when the master MDT try * to init a remote object(see osp_object_init), so if @@ -205,6 +209,8 @@ static int out_attr_get(struct tgt_session_info *tsi) * so the object can be removed from the cache immediately */ set_bit(LU_OBJECT_HEARD_BANSHEE, &obj->do_lu.lo_header->loh_flags); + CDEBUG_LIMIT(level, "%s: update_log_dir is missing?\n", + tgt_name(tsi->tsi_tgt)); RETURN(-ENOENT); } @@ -219,9 +225,9 @@ static int out_attr_get(struct tgt_session_info *tsi) out_unlock: dt_read_unlock(env, obj); - CDEBUG(D_INFO, "%s: insert attr get reply %p index %d: rc = %d\n", - tgt_name(tsi->tsi_tgt), tti->tti_u.update.tti_update_reply, - 0, rc); + CDEBUG_LIMIT(level, "%s: insert attr get reply %p index %d: rc = %d\n", + tgt_name(tsi->tsi_tgt), tti->tti_u.update.tti_update_reply, + 0, rc); object_update_result_insert(tti->tti_u.update.tti_update_reply, obdo, sizeof(*obdo), idx, rc); @@ -1136,12 +1142,14 @@ int out_handle(struct tgt_session_info *tsi) dt_obj = dt_locate_at(env, dt, &update->ou_fid, dt->dd_lu_dev.ld_site->ls_top_dev, &conf); if (IS_ERR(dt_obj)) { + int level = D_HA; + rc = PTR_ERR(dt_obj); - CDEBUG(D_HA, - "%s: opc: 0x%x locate error fid"\ - DFID": rc = %d\n", - tgt_name(tsi->tsi_tgt), - update->ou_type, + if (fid_is_update_log_dir(&update->ou_fid)) + level = D_WARNING; + CDEBUG_LIMIT(level, + "%s: opc: 0x%x locate error fid "DFID": rc = %d\n", + tgt_name(tsi->tsi_tgt), update->ou_type, PFID(&update->ou_fid), rc); GOTO(out, rc); } diff --git a/lustre/target/update_trans.c b/lustre/target/update_trans.c index 900cda1..77f6c4a 100644 --- a/lustre/target/update_trans.c +++ b/lustre/target/update_trans.c @@ -1281,9 +1281,6 @@ 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)) @@ -1306,29 +1303,15 @@ 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); } -- 1.8.3.1