Whamcloud - gitweb
Branch b1_5
authornathan <nathan>
Tue, 11 Jul 2006 16:29:10 +0000 (16:29 +0000)
committernathan <nathan>
Tue, 11 Jul 2006 16:29:10 +0000 (16:29 +0000)
better pinger evict message

lustre/include/lustre/lustre_user.h
lustre/ptlrpc/pinger.c

index bdf4d5a..c306dfa 100644 (file)
@@ -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;
         }
index 5095e7d..787074c 100644 (file)
@@ -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 */