From cf79cf4746e484b93aff4f549823a14db0223f1d Mon Sep 17 00:00:00 2001
From: eeb <eeb>
Date: Wed, 23 May 2007 11:56:33 +0000
Subject: [PATCH] *   ptllnd     - revert default ptltrace_on_timeout to 0 -
 timeouts can be routine in       redundant router configurations.     -
 merged minor fixes from Cray XT 2.0

---
 lnet/klnds/ptllnd/ptllnd_modparams.c | 2 +-
 lnet/klnds/ptllnd/ptllnd_ptltrace.c  | 9 +++++++--
 lnet/klnds/ptllnd/ptllnd_rx_buf.c    | 4 ++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/lnet/klnds/ptllnd/ptllnd_modparams.c b/lnet/klnds/ptllnd/ptllnd_modparams.c
index 044353ab97..1d538e9bc6 100644
--- a/lnet/klnds/ptllnd/ptllnd_modparams.c
+++ b/lnet/klnds/ptllnd/ptllnd_modparams.c
@@ -80,7 +80,7 @@ CFS_MODULE_PARM(ack_puts, "i", int, 0644,
 		"get portals to ack all PUTs");
 
 #ifdef CRAY_XT3
-static int ptltrace_on_timeout = 1;
+static int ptltrace_on_timeout = 0;
 CFS_MODULE_PARM(ptltrace_on_timeout, "i", int, 0644,
 		"dump ptltrace on timeout");
 
diff --git a/lnet/klnds/ptllnd/ptllnd_ptltrace.c b/lnet/klnds/ptllnd/ptllnd_ptltrace.c
index 30064dcbb8..91ba7afefa 100644
--- a/lnet/klnds/ptllnd/ptllnd_ptltrace.c
+++ b/lnet/klnds/ptllnd/ptllnd_ptltrace.c
@@ -48,7 +48,8 @@ kptllnd_ptltrace_to_file(char *filename)
         filp = cfs_filp_open(filename,
                              O_CREAT|O_EXCL|O_WRONLY|O_LARGEFILE, 0600, &rc);
         if (filp == NULL) {
-                CERROR("Error %d creating %s\n", rc, filename);
+                if (rc != -EEXIST)
+                        CERROR("Error %d creating %s\n", rc, filename);
                 goto out;
         }
 
@@ -80,7 +81,11 @@ kptllnd_ptltrace_to_file(char *filename)
                         break;
                 }
 
-                LASSERT (start >= tmpbuf && start + len <= tmpbuf + PAGE_SIZE);
+                if (start < tmpbuf || start + len > tmpbuf + PAGE_SIZE) {
+                        CERROR("ptl_proc_read bug: %p for %d not in %p for %d\n",
+                               start, len, tmpbuf, PAGE_SIZE);
+                        break;
+                }
 
                 rc = cfs_filp_write(filp, start, len, cfs_filp_poff(filp));
                 if (rc != len) {
diff --git a/lnet/klnds/ptllnd/ptllnd_rx_buf.c b/lnet/klnds/ptllnd/ptllnd_rx_buf.c
index ce21e9559b..847e265e28 100644
--- a/lnet/klnds/ptllnd/ptllnd_rx_buf.c
+++ b/lnet/klnds/ptllnd/ptllnd_rx_buf.c
@@ -415,10 +415,10 @@ kptllnd_rx_buffer_callback (ptl_event_t *ev)
                  * odd-length message will misalign subsequent messages and
                  * force the fixup below...  */
                 if ((ev->mlength & 7) != 0)
-                        CWARN("Message from %s has odd length %llu: "
+                        CWARN("Message from %s has odd length "LPU64": "
                               "probable version incompatibility\n",
                               kptllnd_ptlid2str(ev->initiator),
-                              ev->mlength);
+                              (__u64)ev->mlength);
 #endif
                 rx = kptllnd_rx_alloc();
                 if (rx == NULL) {
-- 
GitLab