From patchwork Sat Jul 21 00:41:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 1222821 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 361E1E0079 for ; Sat, 21 Jul 2012 00:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752160Ab2GUAdL (ORCPT ); Fri, 20 Jul 2012 20:33:11 -0400 Received: from cobra.newdream.net ([66.33.216.30]:46562 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752686Ab2GUAdK (ORCPT ); Fri, 20 Jul 2012 20:33:10 -0400 Received: from fatty.ops.newdream.net (unknown [38.122.20.226]) by cobra.newdream.net (Postfix) with ESMTPA id F2B7481356; Fri, 20 Jul 2012 17:33:09 -0700 (PDT) From: Sage Weil To: ceph-devel@vger.kernel.org Cc: Sage Weil Subject: [PATCH 3/9] libceph: report socket read/write error message Date: Fri, 20 Jul 2012 17:41:42 -0700 Message-Id: <1342831308-18815-4-git-send-email-sage@inktank.com> X-Mailer: git-send-email 1.7.9 In-Reply-To: <1342831308-18815-1-git-send-email-sage@inktank.com> References: <1342831308-18815-1-git-send-email-sage@inktank.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org 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 Reviewed-by: Yehuda Sadeh Reviewed-by: Alex Elder --- 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);