Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3003423imm; Sun, 1 Jul 2018 10:05:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcQu2COjVb2KTZCjcPVOZhkg8lBUWu3RJxr/vAcpzzwR51qQiIutz6VN4lntmIkoCcHxeQV X-Received: by 2002:a63:5c10:: with SMTP id q16-v6mr532376pgb.452.1530464751202; Sun, 01 Jul 2018 10:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464751; cv=none; d=google.com; s=arc-20160816; b=MZWOWcqvOqndR65guIoZGgY0qqOfxUYAiJYDuSkRZlPqCHr6WE+p24oa6Ppb6L8FaW 86pwLYeGwyoZ0kdvyaq3pYDghHnXTrnResOdZ4MNGEdhckp6+YGebk0rn5V+0GYvSwfm 5aeYJJ0atH1iBjGTORwTy43vzLQa9I5KqbliNis3l9YxpPx8X9tu06g4Jpqo1mWGARV5 h/jVPEigEvKPZj4hKfzb+CugFZHVvEeRUTROT1IxU8sxJ2lpLuF26vhZ0CsFtOIVqWSY WzjBRh7M9FoUY+dfrVBKo5lkR5utdyN2Du8wiK+HFaQD/FVStQwH4zHsYw4ycFpUwSs0 oatQ== 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=ihRWV4wqnU00Tygk5X6WE+FoAQz33sxboJ50MXvw14s=; b=AfOyng2Gbq24LbeotKwbduFFq2e2jrMsyhnotgamjk7zpQitJEdOmosChAZTcXIThU KxC1cpx0zSXoZ+m6UhSV+u/T/fgfircX8A8lQIn/d1wb2cuzbw67wEcBJR1A8yMQZbDN B+xmiGb27L2o4fU6Y/esfQ7EZvHdPO19IZltX/S2TKUZGiTRNKXCLE95Ao8OuFfXJzgR L2RTAlHlr97TQnXJ/Hi9Nw80SY1JyhjVz13EZihMzvdxTM1QQO9uxf439Y7tb3XP7akT TfQ4wBtIBz06aqUlegagphsJF5lZ22HgLM+UQ0dxCjuW7nX70kcgJ27rujNXDC9c4p0x ZYJw== 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 195-v6si12016553pgb.176.2018.07.01.10.05.36; Sun, 01 Jul 2018 10:05:51 -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 S933317AbeGAREE (ORCPT + 99 others); Sun, 1 Jul 2018 13:04:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37714 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032244AbeGAQmv (ORCPT ); Sun, 1 Jul 2018 12:42:51 -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 BF73BACC; Sun, 1 Jul 2018 16:42:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikhail Malygin , Himanshu Madhani , "Martin K. Petersen" Subject: [PATCH 4.17 137/220] scsi: qla2xxx: Spinlock recursion in qla_target Date: Sun, 1 Jul 2018 18:22:41 +0200 Message-Id: <20180701160914.029216622@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikhail Malygin commit 49d7bd36813ea8e6b4c97b640d24e7fbd44c84f0 upstream. The patch reverts changes done in qlt_schedule_sess_for_deletion() to avoid spinlock recursion sess->vha->work_lock should be used instead of ha->tgt.sess_lock, that can be locked in callers: qlt_reset() or qlt_handle_login() [mkp: roll in build warning reported by sfr] Fixes: 1c6cacf4ea6c04 ("scsi: qla2xxx: Fixup locking for session deletion") Cc: #v4.17 Signed-off-by: Mikhail Malygin Reported-by: Mikhail Malygin Tested-by: Mikhail Malygin Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_target.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1230,7 +1230,6 @@ static void qla24xx_chk_fcp_state(struct void qlt_schedule_sess_for_deletion(struct fc_port *sess) { struct qla_tgt *tgt = sess->tgt; - struct qla_hw_data *ha = sess->vha->hw; unsigned long flags; if (sess->disc_state == DSC_DELETE_PEND) @@ -1247,16 +1246,16 @@ void qlt_schedule_sess_for_deletion(stru return; } - spin_lock_irqsave(&ha->tgt.sess_lock, flags); if (sess->deleted == QLA_SESS_DELETED) sess->logout_on_delete = 0; + spin_lock_irqsave(&sess->vha->work_lock, flags); if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) { - spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); + spin_unlock_irqrestore(&sess->vha->work_lock, flags); return; } sess->deleted = QLA_SESS_DELETION_IN_PROGRESS; - spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); + spin_unlock_irqrestore(&sess->vha->work_lock, flags); sess->disc_state = DSC_DELETE_PEND;