Skip to content

Commit

Permalink
libceph: report socket read/write error message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sage Weil committed Jul 31, 2012
1 parent 546f04e commit 3a140a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -2287,14 +2287,18 @@ static void con_work(struct work_struct *work)
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);
Expand Down

0 comments on commit 3a140a0

Please sign in to comment.