All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch 12/12] tabled: print hostname always
@ 2010-04-18  4:44 Pete Zaitcev
  0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2010-04-18  4:44 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Project Hail List

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 <zaitcev@redhat.com>

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

commit 31dc52b7d177bd18a765a9fc407c2afdd103613e
Author: Master <zaitcev@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 */
 };

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-18  4:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-18  4:44 [Patch 12/12] tabled: print hostname always Pete Zaitcev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.