From patchwork Fri Mar 6 17:56:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Moore X-Patchwork-Id: 5956971 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 65A339F36A for ; Fri, 6 Mar 2015 17:57:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9832520397 for ; Fri, 6 Mar 2015 17:57:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7EE5920374 for ; Fri, 6 Mar 2015 17:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751280AbbCFR5H (ORCPT ); Fri, 6 Mar 2015 12:57:07 -0500 Received: from cmexedge1.emulex.com ([138.239.224.99]:35172 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbbCFR5G convert rfc822-to-8bit (ORCPT ); Fri, 6 Mar 2015 12:57:06 -0500 Received: from CMEXHTCAS1.ad.emulex.com (138.239.115.217) by CMEXEDGE1.ext.emulex.com (138.239.224.99) with Microsoft SMTP Server (TLS) id 14.3.174.1; Fri, 6 Mar 2015 09:56:50 -0800 Received: from CMEXMB1.ad.emulex.com ([169.254.1.60]) by CMEXHTCAS1.ad.emulex.com ([2002:8aef:73d9::8aef:73d9]) with mapi id 14.03.0174.001; Fri, 6 Mar 2015 09:56:36 -0800 From: Chris Moore To: "Sagi Grimberg (sagig@dev.mellanox.co.il)" CC: "linux-rdma@vger.kernel.org" , "target-devel (target-devel@vger.kernel.org)" Subject: [PATCH] iser-target: Handle errors from isert_put_datain and isert_get_dataout Thread-Topic: [PATCH] iser-target: Handle errors from isert_put_datain and isert_get_dataout Thread-Index: AdBYNYWD6PT4wbW/SvWqOX8O7gZlgA== Date: Fri, 6 Mar 2015 17:56:34 +0000 Message-ID: <462EF229174FDB4D92ACE4656EA561005DD2BD41@CMEXMB1.ad.emulex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [138.239.35.161] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP isert_put_datain() always returns 1 and isert_get_dataout() always returns 0, even if ib_post_send() fails. They should return an error in this case so the caller can handle it. Also, in the case of an ib_post_send() failure, user isert_err instead of isert_warn. With these changes, these two functions handle errors from ib_post_send() in the same way as other functions within ib_isert.c Signed-off-by: Chris Moore --- --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 075b19c..7394ba9 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -2860,8 +2860,10 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd) } rc = ib_post_send(isert_conn->conn_qp, wr->send_wr, &wr_failed); - if (rc) - isert_warn("ib_post_send() failed for IB_WR_RDMA_WRITE\n"); + if (rc) { + isert_err("ib_post_send() failed for IB_WR_RDMA_WRITE\n"); + return rc; + } if (!isert_prot_cmd(isert_conn, se_cmd)) isert_dbg("Cmd: %p posted RDMA_WRITE + Response for iSER Data " @@ -2894,8 +2896,10 @@ isert_get_dataout(struct iscsi_conn *conn, struct iscsi_cmd *cmd, bool recovery) } rc = ib_post_send(isert_conn->conn_qp, wr->send_wr, &wr_failed); - if (rc) - isert_warn("ib_post_send() failed for IB_WR_RDMA_READ\n"); + if (rc) { + isert_err("ib_post_send() failed for IB_WR_RDMA_READ\n"); + return rc; + } isert_dbg("Cmd: %p posted RDMA_READ memory for ISER Data WRITE\n", isert_cmd);