Received: by 10.213.65.68 with SMTP id h4csp441536imn; Tue, 13 Mar 2018 09:09:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELtDM9AGz+0n4NA+hcc+CV0RZB0kdNxN6E8MTTlxLpMLJHL3f/xX2gNbZyM56WZh24KJulU3 X-Received: by 10.99.43.67 with SMTP id r64mr890555pgr.403.1520957355278; Tue, 13 Mar 2018 09:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957355; cv=none; d=google.com; s=arc-20160816; b=ZSOaQH61WjTmQZKzsYjImvbzJNiKTK/Sr48zrABfv4eN1gvYfGXBRa2Apy3NmbP7Q9 hfsm0g3ckQwwtsV5mHlCIYiyhQQltO0cT8m5ohmwFjg+a91zcP1mewS8C5s/HZn5bwGd eQ0P6ilEa0v9j3pqIpYTLjAGgAEOeQ26FzQcvhJqqPIZjX6mOZVPmma9Ow+X8Yacq0jf FDdY4sfxaGzvnEmWmgryYEh+5zrlzq/nCNQaoQQyeKqGBpHVHLJKGjMARU6iT3aggxGM sGNrz2oWiYfMdfokrdVuxsoiABsbNMu80yywbSGe3XTXw9xmpbR6ruoMH2yh5CJ8bzAN C9wQ== 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=EXFhv/75ALu9z0jSdXWSbVCcT1fLUEUN2w7W7f5Sn20=; b=jEc6mT446Z1vbJp64byq3ZRQSxHU2FNK9osLZ+5n8fbU6SYqO19u715H1Tr4cp0nY6 gaTAxBI/T/GtFUwAfcPceZjxRZ/VYDfEOvDp3TfYwQFFme6AivtDkqgR1kgIzaxSa6VT cm+auIxF6XPWLG7Hg9bg2aJJCMtUdKVtrZw9VjN7YqifoIxGL5IPAKKw2Z20NptzNd/G va/COeMk4bdpzbtXzQdJv5/S4D/cOdHT+q6maaf6j/hf/v3Eqf6rfHpdO7PXwV8QyOLp wRZovgBS4TpyaIJXB3WYHus1yCjVazR9LqI85Dq9YAOU9YbuIhwVnuQXUXNdA7C5RdsO dOXw== 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 z7si315143pfg.278.2018.03.13.09.08.59; Tue, 13 Mar 2018 09:09:15 -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 S933860AbeCMQHp (ORCPT + 99 others); Tue, 13 Mar 2018 12:07:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33654 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932638AbeCMPgm (ORCPT ); Tue, 13 Mar 2018 11:36:42 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C246511F2; Tue, 13 Mar 2018 15:36:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quinn Tran , Himanshu Madhani , Hannes Reinecke , "Martin K. Petersen" Subject: [PATCH 4.14 038/140] scsi: qla2xxx: Clear loop id after delete Date: Tue, 13 Mar 2018 16:24:01 +0100 Message-Id: <20180313152500.698718331@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Quinn Tran commit ba743f9148e951abe1c94f89c174ec8e44fb145b upstream. Clear loop id after delete to prevent session invalidation of stale session. Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_target.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -974,7 +974,7 @@ static void qlt_free_session_done(struct qlt_send_first_logo(vha, &logo); } - if (sess->logout_on_delete) { + if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) { int rc; rc = qla2x00_post_async_logout_work(vha, sess, NULL); @@ -1033,8 +1033,7 @@ static void qlt_free_session_done(struct sess->login_succ = 0; } - if (sess->chip_reset != ha->base_qpair->chip_reset) - qla2x00_clear_loop_id(sess); + qla2x00_clear_loop_id(sess); if (sess->conflict) { sess->conflict->login_pause = 0; @@ -4588,9 +4587,9 @@ qlt_find_sess_invalidate_other(scsi_qla_ "Invalidating sess %p loop_id %d wwn %llx.\n", other_sess, other_sess->loop_id, other_wwn); - other_sess->keep_nport_handle = 1; - *conflict_sess = other_sess; + if (other_sess->disc_state != DSC_DELETED) + *conflict_sess = other_sess; qlt_schedule_sess_for_deletion(other_sess, true); }