aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-07-30 19:24:21 -0400
committerSage Weil <sage@inktank.com>2012-07-30 21:15:29 -0400
commit3a140a0d5c4b9e35373b016e41dfc85f1e526bdb (patch)
treee145ddbb09f0493fa60c98406f6b84f36b94fb95 /net/ceph
parent546f04ef716dd49521774653d8b032a7d64c05d9 (diff)
libceph: report socket read/write error message
We need to set error_msg to something useful before calling ceph_fault(); do so here for try_{read,write}(). This is more informative than libceph: osd0 192.168.106.220:6801 (null) Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 63e1252d3af5..6e2f67816f61 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2287,14 +2287,18 @@ restart:
2287 ret = try_read(con); 2287 ret = try_read(con);
2288 if (ret == -EAGAIN) 2288 if (ret == -EAGAIN)
2289 goto restart; 2289 goto restart;
2290 if (ret < 0) 2290 if (ret < 0) {
2291 con->error_msg = "socket error on read";
2291 goto fault; 2292 goto fault;
2293 }
2292 2294
2293 ret = try_write(con); 2295 ret = try_write(con);
2294 if (ret == -EAGAIN) 2296 if (ret == -EAGAIN)
2295 goto restart; 2297 goto restart;
2296 if (ret < 0) 2298 if (ret < 0) {
2299 con->error_msg = "socket error on write";
2297 goto fault; 2300 goto fault;
2301 }
2298 2302
2299done: 2303done:
2300 mutex_unlock(&con->mutex); 2304 mutex_unlock(&con->mutex);