libceph: report socket read/write error message
authorSage Weil <sage@inktank.com>
Mon, 30 Jul 2012 23:24:21 +0000 (16:24 -0700)
committerSage Weil <sage@inktank.com>
Tue, 31 Jul 2012 01:15:29 +0000 (18:15 -0700)
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>
net/ceph/messenger.c

index 63e1252d3af5d68115f0384c16bea694234b3a32..6e2f67816f61d4ccfa3aa580737b69ccc649e1a2 100644 (file)
@@ -2287,14 +2287,18 @@ restart:
        ret = try_read(con);
        if (ret == -EAGAIN)
                goto restart;
-       if (ret < 0)
+       if (ret < 0) {
+               con->error_msg = "socket error on read";
                goto fault;
+       }
 
        ret = try_write(con);
        if (ret == -EAGAIN)
                goto restart;
-       if (ret < 0)
+       if (ret < 0) {
+               con->error_msg = "socket error on write";
                goto fault;
+       }
 
 done:
        mutex_unlock(&con->mutex);