Whamcloud - gitweb
landing b_cmobd_merge on HEAD
[fs/lustre-release.git] / lustre / ptlrpc / pinger.c
index f1e68e7..05d3fff 100644 (file)
@@ -38,8 +38,6 @@
 static DECLARE_MUTEX(pinger_sem);
 static struct list_head pinger_imports = LIST_HEAD_INIT(pinger_imports);
 
-static struct ptlrpc_thread *pinger_thread = NULL;
-
 int ptlrpc_ping(struct obd_import *imp) 
 {
         struct ptlrpc_request *req;
@@ -82,7 +80,10 @@ static int ptlrpc_pinger_main(void *arg)
         RECALC_SIGPENDING;
         SIGNAL_MASK_UNLOCK(current, flags);
 
-        THREAD_NAME(current->comm, "%s", data->name);
+        LASSERTF(strlen(data->name) < sizeof(current->comm),
+                 "name %d > len %d\n",
+                 (int)strlen(data->name), (int)sizeof(current->comm));
+        THREAD_NAME(current->comm, sizeof(current->comm) - 1, "%s", data->name);
         unlock_kernel();
 
         /* Record that the thread is running */
@@ -170,6 +171,8 @@ static int ptlrpc_pinger_main(void *arg)
         return 0;
 }
 
+static struct ptlrpc_thread *pinger_thread = NULL;
+
 int ptlrpc_start_pinger(void)
 {
         struct l_wait_info lwi = { 0 };