From: nathan Date: Tue, 11 Jul 2006 16:29:10 +0000 (+0000) Subject: Branch b1_5 X-Git-Tag: v1_7_100~1^90~8^2~13 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=96af3e11a88d845676ea859f49eaab54a04f2296;p=fs%2Flustre-release.git Branch b1_5 better pinger evict message --- diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index bdf4d5a..c306dfa 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -148,9 +148,10 @@ static inline void obd_str2uuid(struct obd_uuid *uuid, char *tmp) static inline char *obd_uuid2str(struct obd_uuid *uuid) { if (uuid->uuid[sizeof(*uuid) - 1] != '\0') { - /* Obviously not safe, but for printfs, no real harm done...*/ + /* Obviously not safe, but for printfs, no real harm done... + we're always null-terminated, even in a race. */ static char temp[sizeof(*uuid)]; - memcpy(temp, uuid->uuid, sizeof(*uuid)); + memcpy(temp, uuid->uuid, sizeof(*uuid) - 1); temp[sizeof(*uuid) - 1] = '\0'; return temp; } diff --git a/lustre/ptlrpc/pinger.c b/lustre/ptlrpc/pinger.c index 5095e7d..787074c 100644 --- a/lustre/ptlrpc/pinger.c +++ b/lustre/ptlrpc/pinger.c @@ -372,23 +372,21 @@ static int ping_evictor_main(void *arg) while (!list_empty(&obd->obd_exports_timed)) { exp = list_entry(obd->obd_exports_timed.next, struct obd_export,exp_obd_chain_timed); - if (expire_time > exp->exp_last_request_time) { class_export_get(exp); spin_unlock(&obd->obd_dev_lock); - LCONSOLE_WARN("%s: haven't heard from %s in %ld" - " seconds. Last request was at %ld. " - "I think it's dead, and I am evicting " - "it.\n", obd->obd_name, + LCONSOLE_WARN("%s: haven't heard from client %s" + " (at %s) in %ld seconds. I think" + " it's dead, and I am evicting" + " it.\n", obd->obd_name, + obd_uuid2str(&exp->exp_client_uuid), obd_export_nid2str(exp), (long)(CURRENT_SECONDS - - exp->exp_last_request_time), - exp->exp_last_request_time); - - + exp->exp_last_request_time)); + CDEBUG(D_HA, "Last request was at %ld\n", + exp->exp_last_request_time); class_fail_export(exp); class_export_put(exp); - spin_lock(&obd->obd_dev_lock); } else { /* List is sorted, so everyone below is ok */