This code clearly was obsolete and wishful thinking. Let's just be
simple. Most importantly print something that tells the sysadmin
what node is the problem.

Signed-off-by: Pete Zaitcev <zait...@redhat.com>

---
 server/storage.c |   19 +++----------------
 server/tabled.h  |    2 +-
 2 files changed, 4 insertions(+), 17 deletions(-)

commit 31dc52b7d177bd18a765a9fc407c2afdd103613e
Author: Master <zait...@lembas.zaitcev.lan>
Date:   Sat Apr 17 20:42:24 2010 -0600

    Print host name in storage retries.

diff --git a/server/storage.c b/server/storage.c
index 1793fa0..a63012e 100644
--- a/server/storage.c
+++ b/server/storage.c
@@ -489,26 +489,13 @@ void stor_add_node(uint32_t nid, const char *hostname, 
const char *portstr,
 int stor_node_check(struct storage_node *stn)
 {
        struct st_client *stc;
-       char host[41];
-       char port[6];
        int rc;
 
        rc = stor_new_stc(stn, &stc);
        if (rc < 0) {
-               if (rc == -EINVAL) {
-                       if (getnameinfo((struct sockaddr *) &stn->addr,
-                                       stn->alen, host, sizeof(host),
-                                       port, sizeof(port),
-                                       NI_NUMERICHOST|NI_NUMERICSERV) == 0) {
-                               applog(LOG_INFO, "Error connecting to chunkd"
-                                      " on host %s port %s",
-                                      host, port);
-                       } else {
-                               applog(LOG_INFO, "Error connecting to chunkd");
-                       }
-               } else {
-                       applog(LOG_INFO, "Error %d connecting to chunkd", rc);
-               }
+               applog(LOG_INFO,
+                      "Error %d connecting to chunkd on host %s",
+                      rc, stn->hostname);
                return -1;
        }
 
diff --git a/server/tabled.h b/server/tabled.h
index eced4b6..75fa147 100644
--- a/server/tabled.h
+++ b/server/tabled.h
@@ -96,7 +96,7 @@ struct storage_node {
 
        unsigned                alen;
        struct sockaddr_in6     addr;
-       char *hostname;         /* Only used because stc_new is overly smart. */
+       char                    *hostname;
 
        int ref;                /* number of open_chunk or other */
 };
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to