summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-07-30 16:24:21 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-26 11:38:39 -0800
commitb3fd00b73452353444c768b19bb175ec95410c8f (patch)
tree50931fcc448eac85d3eca1ca27ba04f8b4141254
parent59d02721bb2838893596d5617659fe907dd45518 (diff)
downloadlinux-3.10-b3fd00b73452353444c768b19bb175ec95410c8f.tar.gz
linux-3.10-b3fd00b73452353444c768b19bb175ec95410c8f.tar.bz2
linux-3.10-b3fd00b73452353444c768b19bb175ec95410c8f.zip
libceph: report socket read/write error message
(cherry picked from commit 3a140a0d5c4b9e35373b016e41dfc85f1e526bdb) 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 edd51321ae1..96d9c9960aa 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -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);