From: Li Wei Date: Sun, 25 Nov 2012 07:48:00 +0000 (+0800) Subject: LU-2285 osp: Enhance pre-creation-related debug messages X-Git-Tag: 2.3.57~37 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9275e0c44facf4db7c470a629e314f6e26e9685c LU-2285 osp: Enhance pre-creation-related debug messages This patch adds a couple of debug messages to help diagnose osp's pre-creation code. It also fixes OBD names and print formats in a few related messages. Change-Id: Ide153834511360855f390e7f35e85a389d0bd4db Signed-off-by: Li Wei Reviewed-on: http://review.whamcloud.com/4668 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Alex Zhuravlev --- diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c index 94f4d3f..58d7824 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c @@ -172,6 +172,8 @@ static int osp_last_used_init(const struct lu_env *env, struct osp_device *m) if (rc) GOTO(out, rc); } + CDEBUG(D_HA, "%s: Read last used ID: "LPU64"\n", m->opd_obd->obd_name, + le64_to_cpu(m->opd_last_used_id)); RETURN(0); out: CERROR("%s: can't initialize lov_objid: %d\n", diff --git a/lustre/osp/osp_object.c b/lustre/osp/osp_object.c index d2bcde5..d94b5b9 100644 --- a/lustre/osp/osp_object.c +++ b/lustre/osp/osp_object.c @@ -288,6 +288,9 @@ static int osp_object_create(const struct lu_env *env, struct dt_object *dt, rc = dt_record_write(env, d->opd_last_used_file, &osi->osi_lb, &osi->osi_off, th); + CDEBUG(D_HA, "%s: Wrote last used ID: "LPU64": %d\n", + d->opd_obd->obd_name, le64_to_cpu(d->opd_last_used_id), rc); + RETURN(rc); } diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c index 4adf222..04f8682 100644 --- a/lustre/osp/osp_precreate.c +++ b/lustre/osp/osp_precreate.c @@ -280,7 +280,8 @@ static int osp_precreate_send(struct osp_device *d) if (body == NULL) GOTO(out_req, rc = -EPROTO); - CDEBUG(D_HA, "new last_created %lu\n", (unsigned long) body->oa.o_id); + CDEBUG(D_HA, "%s: new last_created "LPU64"\n", d->opd_obd->obd_name, + body->oa.o_id); LASSERT(body->oa.o_id > d->opd_pre_used_id); diff = body->oa.o_id - d->opd_pre_last_created; @@ -440,8 +441,8 @@ static int osp_precreate_cleanup_orphans(struct osp_device *d) d->opd_pre_grow_slow = 0; cfs_spin_unlock(&d->opd_pre_lock); - CDEBUG(D_HA, "Got last_id "LPU64" from OST, last_used is "LPU64 - ", next "LPU64"\n", body->oa.o_id, + CDEBUG(D_HA, "%s: Got last_id "LPU64" from OST, last_used is "LPU64 + ", pre_used "LPU64"\n", d->opd_obd->obd_name, body->oa.o_id, le64_to_cpu(d->opd_last_used_id), d->opd_pre_used_id); out: