Received: by 10.192.165.148 with SMTP id m20csp2488026imm; Sun, 22 Apr 2018 08:04:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Y0rdmX1Vfi64Munp9S8GMpWfbZQHNaq/rJ4Xr2lxCm70Obr9KUnn5qcrGrA3wvg7hYsm7 X-Received: by 10.99.97.139 with SMTP id v133mr14078934pgb.285.1524409451703; Sun, 22 Apr 2018 08:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524409451; cv=none; d=google.com; s=arc-20160816; b=QjVsFdrTmGW8HKOy7tfUNZPg3nk9wdZzOIh0ke1eHlKfpR5Iq/72j/FBUah6cWmYvw CKX/QvSub8sD+IKkxxlUCaX6xJ5e4ZJElPG0P5YBSsBCYdQF76X2GB2JqyNZB1ZF7XBt /UoO62t5HBT4UYG1srpPSspf0lqhNul5NvQ2oBoHJzEMu+R+Ip4tJhqDQv1qmUIW/4g7 4DgTvev7ZeRFKtZfpp+fc4VYArd2qGINNzTGjzg3owCUl2EhlvTNNYnkezIDsyhNsiYN jb3UFR6sORO32zVHNzpIi30T2hgRY4gNZoN7hZIqVShbxt+H6FJsxNwxwezXd8CFd1GH Gkag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ZZNC5X92Kjz363YsjTBmSAtFC+o1cP1hTio8dH/RNCU=; b=oJubySarJ++zbsZ8B1lYiHQvbQWjGK/kKFJ3P6C9sCk07THBnYltPcJAFGRYbQgf3T 6yqMdfRR61gl16Es1czQEm9KPCTDwttIYyZWBIEfLOIjFtPOw0zIA3rAB045gXnePDJA CHpuWacOfzV1ZXzejugnjT+E0yPTcwXRNhGcoGBOIhd+oGF2NYW0Gdu4Fy45u/t+nTBp 6nSOeqt+j4LfV8l3O28Gr0Rz+XGQ8AJw0xl+mwAtftOYoGYvlzowvjPHfHsjYF5C5YfZ tvQF6Rz/l1E9MdujoHckN7JJGrr7To94lMxw5mpe4QN8YwPhn579/0itlhJ/XayLRVhO N2TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b62si3439934pgc.505.2018.04.22.08.03.56; Sun, 22 Apr 2018 08:04:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754807AbeDVPBr (ORCPT + 99 others); Sun, 22 Apr 2018 11:01:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55182 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756723AbeDVOMk (ORCPT ); Sun, 22 Apr 2018 10:12:40 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DD8B7CC6; Sun, 22 Apr 2018 14:12:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bart Van Assche , Jason Gunthorpe Subject: [PATCH 4.9 42/95] IB/srp: Fix srp_abort() Date: Sun, 22 Apr 2018 15:53:11 +0200 Message-Id: <20180422135212.138989249@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche commit e68088e78d82920632eba112b968e49d588d02a2 upstream. Before commit e494f6a72839 ("[SCSI] improved eh timeout handler") it did not really matter whether or not abort handlers like srp_abort() called .scsi_done() when returning another value than SUCCESS. Since that commit however this matters. Hence only call .scsi_done() when returning SUCCESS. Signed-off-by: Bart Van Assche Cc: stable@vger.kernel.org Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/srp/ib_srp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2626,9 +2626,11 @@ static int srp_abort(struct scsi_cmnd *s ret = FAST_IO_FAIL; else ret = FAILED; - srp_free_req(ch, req, scmnd, 0); - scmnd->result = DID_ABORT << 16; - scmnd->scsi_done(scmnd); + if (ret == SUCCESS) { + srp_free_req(ch, req, scmnd, 0); + scmnd->result = DID_ABORT << 16; + scmnd->scsi_done(scmnd); + } return ret; }