Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5765654ybv; Tue, 11 Feb 2020 23:26:15 -0800 (PST) X-Google-Smtp-Source: APXvYqwK9xCK7AmXxPCUcMw9C4lwVlW4jdlS+yfeMYw+UwnB9jO41IaeZDyOxhaff4hBu/f8/UHz X-Received: by 2002:a9d:4e99:: with SMTP id v25mr8486276otk.363.1581492375421; Tue, 11 Feb 2020 23:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581492375; cv=none; d=google.com; s=arc-20160816; b=mUOAFk8M82G/QeiGrexDuzXm43mhpSAkQOIvciuAR3CW+WvtD4zccaAtcn390JogK+ ncI5nnG88FHLUeAOopQdup516Y4E+FfIbR6IEhJ/eLggQb/nnk7LeWci/7XbA8nnQybx AkO7A1atPlX4jBd3lfqYqRNELHr5H/r/X9eC5RL+N7wvFtMPTSVQZ00o3ceeY9D/AQcu 2wKMfA/HvXxwkPIm6D05RWS9vsjNcgqgEMeuxG8PMAszOV2mFTWtlT1mFGhpVtK1Dszn KoTZWC+Jh+RyxHj5pIUJZ5rmE/lxwgAwNHaTzrvHVezkffMgvs4KsXORGEhSzgmoM2si zCKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=vsblHe4BrZXvpcTixylwUCR+Uct1lSaVWajbm+319XI=; b=oFHpMTqNdYoDcprHC3vF9cgMWo5jZgKCpwGfvBk0NhW7AFF6Qpo3bLe0H8opsCmAaL no+oT7BNjlDKaMjbp3oH8v1m1a6JGZX8wU/ttt7OplIKkDkuF0+ijabydJVR8Ap/1GOo m4EuNsXpgFCeqP21pIhh6yzXn1/GU6CjUC8qqiwkgSpFm3yzBtvlQHGe22Drc+xZXCF+ uv2c31BAo0TP26+gntCmf2pi9823QrVEcxJ+gZs8ZL25pv3WXJGNt8d2QFegVKW0hQ1l WQN4QQM3H5z+18ahpahqOJi1JH+sjaxdoBzODmGndy31fR5TaYCrRZjhLUPPurcT6Np/ Lf1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HYj9kQWz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21si3233547otr.235.2020.02.11.23.26.03; Tue, 11 Feb 2020 23:26:15 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HYj9kQWz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728328AbgBLHZw (ORCPT + 99 others); Wed, 12 Feb 2020 02:25:52 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44876 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728237AbgBLHZw (ORCPT ); Wed, 12 Feb 2020 02:25:52 -0500 Received: by mail-pf1-f195.google.com with SMTP id y5so776166pfb.11; Tue, 11 Feb 2020 23:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :in-reply-to; bh=vsblHe4BrZXvpcTixylwUCR+Uct1lSaVWajbm+319XI=; b=HYj9kQWzQZ3fTJMk/bGjgfSATXE1MFXHn2Bh1bfBiqZL5oU1T/C6I4MSTVU5O4AX91 BM/yA4DXtx9BpAXYND1akj0Z4GZ4pxCjV3+d0y+4jG7rgIhT4EQJCz7TgimW6coMuaW0 nxKmXGPboS5FSnkZd878rI4rXkrUevqhM3XOsh2oFB+r+hHzwWbiuR9qEeWYJhznIqYp Gv17x96BCWlZVUWNYjXZsrE40l1Oug8Qc7+wI0MncYS/I+BxtZvxKNTrU5xbbgxqo55S knHy4QuAGo0sHzdH+zkLtT6p8CiEzXMNAUTwoE8I6oyIIzQV8GAHjgSbLFCImIaVYTMD iZnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:in-reply-to; bh=vsblHe4BrZXvpcTixylwUCR+Uct1lSaVWajbm+319XI=; b=Pl1l5+fiUqxf4cHv7D8c9z/Xx5JBJYJ2nrA/Ht08DnXqoIui3IqJO2BG5eRzWU3NqK pvO6Ss7/IBpFT6Sl/Ks5bCYRLsQTKxFERvyp4WrKQ10Rzd+eSLYyL4vvXEOHilniBY26 Jmc+MMscX8NY6CwZSTH/yQbZTYJa2oOUwYgp+zGq0f5YyIFS5/j+4VVOm1rUjYl4DDTZ te5CbRBglq5x7sTPpAAlrEdDwe4aiJQ5XiIrTmbJYlmW1ndqHYG/cyygwxybsgfMmybT swuIAOmQv9zOs5lNSkMHu3Byrj8P4Y08EeFuzfE3DrszaN+VG6WAuwBn4R/1BXNGdzk2 q8eg== X-Gm-Message-State: APjAAAUD7qeK3CQgs+1FO+4ewPzSKbxG81D1mHsDbhaF+SVAwSoin+Un rccWhMEgU3+OiCVBkq38P8I= X-Received: by 2002:aa7:8804:: with SMTP id c4mr7328335pfo.214.1581492349926; Tue, 11 Feb 2020 23:25:49 -0800 (PST) Received: from workstation-portable ([103.211.17.79]) by smtp.gmail.com with ESMTPSA id e2sm5510979pjs.25.2020.02.11.23.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 23:25:49 -0800 (PST) Date: Wed, 12 Feb 2020 12:55:43 +0530 From: Amol Grover To: Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" , Amol Grover Subject: [PATCH 2/2 RESEND] scsi: qedf: qedf_main: Pass lockdep expression to RCU lists Message-ID: <20200212072543.GI14453@workstation-portable> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200212072339.GH14453@workstation-portable> X-Mailer: git-send-email 2.24.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org lport->disc.rports is traversed using list_for_each_entry_rcu outside an RCU read-side critical section but under the protection of lport->disc.disc_mutex. Hence, add corresponding lockdep expression to silence false-positive lockdep warnings, and harden RCU lists. Signed-off-by: Amol Grover --- drivers/scsi/qedf/qedf_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 604856e72cfb..17eab7f8cf05 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -420,7 +420,8 @@ static void qedf_link_recovery(struct work_struct *work) * ADISC since the rport is in state ready. */ mutex_lock(&lport->disc.disc_mutex); - list_for_each_entry_rcu(rdata, &lport->disc.rports, peers) { + list_for_each_entry_rcu(rdata, &lport->disc.rports, peers, + lockdep_is_held(&lport->disc.disc_mutex)) { if (kref_get_unless_zero(&rdata->kref)) { fc_rport_login(rdata); kref_put(&rdata->kref, fc_rport_destroy); -- 2.24.1