diff mbox

[3/9] libceph: report socket read/write error message

Message ID 1342831308-18815-4-git-send-email-sage@inktank.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sage Weil July 21, 2012, 12:41 a.m. UTC
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>
---
 net/ceph/messenger.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

Comments

Yehuda Sadeh July 24, 2012, 10:26 p.m. UTC | #1
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>

On Fri, Jul 20, 2012 at 5:41 PM, Sage Weil <sage@inktank.com> wrote:
> 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>
> ---
>  net/ceph/messenger.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index 12419a0..7105908 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -2291,14 +2291,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);
> --
> 1.7.9
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alex Elder July 30, 2012, 6:37 p.m. UTC | #2
On 07/20/2012 07:41 PM, Sage Weil wrote:
> 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>

Looks good.

Reviewed-by: Alex Elder <elder@inktank.com>

> ---
>  net/ceph/messenger.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index 12419a0..7105908 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -2291,14 +2291,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);
> 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 12419a0..7105908 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2291,14 +2291,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);