From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423576AbdDUSmO (ORCPT ); Fri, 21 Apr 2017 14:42:14 -0400 Received: from ale.deltatee.com ([207.54.116.67]:36935 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422882AbdDUSmL (ORCPT ); Fri, 21 Apr 2017 14:42:11 -0400 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org Cc: "James E.J. Bottomley" , "Martin K. Petersen" , Lee Duncan , Chris Leech , Varun Prakash , Christoph Hellwig , Logan Gunthorpe Date: Fri, 21 Apr 2017 12:42:01 -0600 Message-Id: <1492800121-21840-1-git-send-email-logang@deltatee.com> X-Mailer: git-send-email 2.1.4 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: open-iscsi@googlegroups.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, lduncan@suse.com, cleech@redhat.com, varun@chelsio.com, hch@lst.de, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH] libiscsi: Add an internal error code X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a prep patch to add a new error code to libiscsi. We want to rework some kmap calls to be able to fail. When we do, we'd like to use this error code. This patch simply introduces ISCSI_TCP_INTERNAL_ERR and prints "Internal Error." when it gets hit. Signed-off-by: Logan Gunthorpe --- Please see these links for additional context. https://patchwork.kernel.org/patch/9680329/ https://patchwork.kernel.org/patch/9680091/ Thanks, Logan drivers/scsi/cxgbi/libcxgbi.c | 5 +++++ include/scsi/libiscsi_tcp.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index bd7d39e..e38d0c1 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -1556,6 +1556,11 @@ static inline int read_pdu_skb(struct iscsi_conn *conn, */ iscsi_conn_printk(KERN_ERR, conn, "Invalid pdu or skb."); return -EFAULT; + case ISCSI_TCP_INTERNAL_ERR: + pr_info("skb 0x%p, off %u, %d, TCP_INTERNAL_ERR.\n", + skb, offset, offloaded); + iscsi_conn_printk(KERN_ERR, conn, "Internal error."); + return -EFAULT; case ISCSI_TCP_SEGMENT_DONE: log_debug(1 << CXGBI_DBG_PDU_RX, "skb 0x%p, off %u, %d, TCP_SEG_DONE, rc %d.\n", diff --git a/include/scsi/libiscsi_tcp.h b/include/scsi/libiscsi_tcp.h index 30520d5..90691ad 100644 --- a/include/scsi/libiscsi_tcp.h +++ b/include/scsi/libiscsi_tcp.h @@ -92,6 +92,7 @@ enum { ISCSI_TCP_SKB_DONE, /* skb is out of data */ ISCSI_TCP_CONN_ERR, /* iscsi layer has fired a conn err */ ISCSI_TCP_SUSPENDED, /* conn is suspended */ + ISCSI_TCP_INTERNAL_ERR, /* an internal error occurred */ }; extern void iscsi_tcp_hdr_recv_prep(struct iscsi_tcp_conn *tcp_conn); -- 2.1.4