From patchwork Wed Nov 14 18:17:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 10682991 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F021913BF for ; Wed, 14 Nov 2018 18:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3F762BE79 for ; Wed, 14 Nov 2018 18:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D79512BE7F; Wed, 14 Nov 2018 18:17:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E18F2BE7D for ; Wed, 14 Nov 2018 18:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727835AbeKOEVW (ORCPT ); Wed, 14 Nov 2018 23:21:22 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52038 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727576AbeKOEVW (ORCPT ); Wed, 14 Nov 2018 23:21:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=q25/RW2qijEY8KUtcDZd0BO7Ygx3yun+faNPLyVuXmU=; b=ERHwig4yhan0Z1NJMgyySoMo5 EE+PgxBPx40nzIl2JYxWI1ixM3nkH1JvABLxp6jqKpB5elCDXyEbiYyWVVUmossT1JobxYUnH5fXS pKcD3GAscVjzcLBl+Y8Qv+CFgjjQd2lM10uMNqHJdKVeCvtukEIYS19+S633/pq/lGaCBCXl1QX0u dSv1c+hEXUgNWZF1uLNOOErjxpTYv8ncRKS9FyOd/LpljanJeMWDA/suMjWbB6zoxS4Wx0WLzDRRv ucFF53mvCAOXSfsp2/sILSSKCl4Cl1wFThFbnPdXri4eAXIab8MVodjusLHDBA9C1T3PM9M0jakwY /QUuzUeMA==; Received: from [52.119.64.114] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMziq-0007Q2-6H; Wed, 14 Nov 2018 18:17:06 +0000 From: Sagi Grimberg To: linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org Cc: Dan Carpenter , stable@vger.kernel.org Subject: [PATCH] iser: set sector for ambiguous mr status errors Date: Wed, 14 Nov 2018 10:17:01 -0800 Message-Id: <20181114181701.26417-1-sagi@grimberg.me> X-Mailer: git-send-email 2.17.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If for some reason we failed to query the mr status, we need to make sure to provide sufficient information for an ambiguous error (guard error on sector 0). Fixes: 0a7a08ad6f5f ("IB/iser: Implement check_protection") Cc: Reported-by: Dan Carpenter Signed-off-by: Sagi Grimberg --- drivers/infiniband/ulp/iser/iser_verbs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 946b623ba5eb..ab137bafa8a8 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c @@ -1124,7 +1124,9 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, IB_MR_CHECK_SIG_STATUS, &mr_status); if (ret) { pr_err("ib_check_mr_status failed, ret %d\n", ret); - goto err; + /* Not alot we can do, return ambiguous guard error */ + *sector = 0; + return 0x1; } if (mr_status.fail_status & IB_MR_CHECK_SIG_STATUS) { @@ -1152,9 +1154,6 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, } return 0; -err: - /* Not alot we can do here, return ambiguous guard error */ - return 0x1; } void iser_err_comp(struct ib_wc *wc, const char *type)