[PATCH] iser-target: Handle errors from isert_put_datain and isert_get_dataout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <chris.moore@xxxxxxxxxx>

---

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);
---

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




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux