Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9178206ybl; Fri, 17 Jan 2020 07:34:41 -0800 (PST) X-Google-Smtp-Source: APXvYqySWZEEMpLkz6SnWTiP5dRyMRcrhhTvxAzD8nv+m85GdQ0XtOn5SI95sojShLJvxC9eaa9V X-Received: by 2002:a9d:ed5:: with SMTP id 79mr6497668otj.72.1579275281750; Fri, 17 Jan 2020 07:34:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579275281; cv=none; d=google.com; s=arc-20160816; b=TmOR/hdWihtBjdNToJNQtScLoW1XlFtFTyHi/HUZ5D7uzmZlyhErHY1QFsCbahZIvG YK2Fj+pvhf5yvfu321tOjVRP0SU8M3L1R3yD6ZJ4wzXTQ6Q2ag3kY25XsIGcFkOmnaHc +8x70xRdi8IPAt8mG9enJNjvKeAs8zpoeTN9e4dB+UYDPDO8dqMBIYxcxr8crTIJlZsE ZyhYl8BKJ2JdcQjyX9PkAfi8UJf7Xx9rA04INBt6l4qwN6EiVTL980pwMlkP6VE+AVox IfNVO+w4H+QUJSm8hp8KMBw2IDN2fOdx6DHRPyySVUN8ca7FsN+jSffOPyn72A6NeP+E 3icQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vsblHe4BrZXvpcTixylwUCR+Uct1lSaVWajbm+319XI=; b=MOTp/FWuQNf5bQSauv+R+cD3RvfkTg0gI/Fi9XsyZdkeKyJCR5HUyYHBSTSrT2BXbk EIK4YqzdZanmFCQvyW23VKujx388TI51OyucBwGVi+GB2wmvPgQLcxroyqJKdwkTlQQE mLREsAeeJ+yUxM5ZYiqAYqjwGboT/fWEPt/PSCd9iWuc0sOm62t4atm8OGv255rF7BcH Xf1SwtS1S+3Kgh5bhOKyIFzv4Vb/O5d/iNFIZQkVATM0cyweuCU2k7WfKqeIYukcpFBy Na6h+DnbaXpqXc4BETs+75iaMbNNV4a+YDx3jgdvhH9kFazxMIJRJMtPEJDIrbY5u7x7 SscQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P84BI8hW; 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 l84si13103840oig.5.2020.01.17.07.34.29; Fri, 17 Jan 2020 07:34:41 -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=P84BI8hW; 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 S1729164AbgAQPcK (ORCPT + 99 others); Fri, 17 Jan 2020 10:32:10 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43711 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbgAQPcJ (ORCPT ); Fri, 17 Jan 2020 10:32:09 -0500 Received: by mail-pf1-f193.google.com with SMTP id x6so12109674pfo.10; Fri, 17 Jan 2020 07:32:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vsblHe4BrZXvpcTixylwUCR+Uct1lSaVWajbm+319XI=; b=P84BI8hWdgxcB+0kowQ9tTtH+clpCV53/uwgm1fVI3l8tZjFgkNNRf3A3bWGHBpJN1 L2X6gHUqblk8BNR1ihsyAebJ9nWxkeTvSQXlYM/aorOhx5T5kWXu1H2RSP2jbA1+p2u1 t1tVDMlGoGu+e++dT6VlGayNKXBK6Y7hnpBCTZ5PXF3rykHUEcgVb/2LROaEmBJPP7q1 hr9Jwq4PHcB+SOOyvs8L8lFEd1AxMtB4Kji7061vXqQxlAHP6QjGtJH3DdLOG7QqzHxG GolP3+EQ6m2rIBo0KTDBekAbZ+vxVLOaBj7OQk5nQiyzvQu5LlaaiMyQv+qLtPew1jkK QR3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vsblHe4BrZXvpcTixylwUCR+Uct1lSaVWajbm+319XI=; b=t6qZlQgXo0GZvY6HX8Luq3PqnUbYU7B0GluCK1WtZCKk2z8ornhATs76/I+CM9AwWW 0LDVT1FjI2M4NJ4PVIOuTII6dpDRpl0vrZUZFIVqGtDFUCCeHPcxVwZT2iCE8CDmZt8I afdYKPb9suewIHroY57+ZzscoUghkQdTK6eHmjFNEG8MF7S1vLy2MD+r0dxrny+b4CHW pi3GGJ5PmZy9c651mYGlnRbOkPbMlRcWBvvIHq9dqpr0l1iydibgmHps/K9n6N669Q/O 9acuh06DRUFbb3SzJhwnPofc7uty2l/uCDYF640tQ9KsyFsoF26WQc4w0b2wqYWdtmLk CdkQ== X-Gm-Message-State: APjAAAX4FphzzmfIcrEaUY/QmAPdXWnsO4sAO0jQw6PrW9x3eQHRgLx4 PsN5rp2+SJwjUPKC/+DApLg= X-Received: by 2002:a63:2842:: with SMTP id o63mr46669470pgo.317.1579275129159; Fri, 17 Jan 2020 07:32:09 -0800 (PST) Received: from localhost.localdomain ([103.211.17.168]) by smtp.googlemail.com with ESMTPSA id d20sm7851020pjs.2.2020.01.17.07.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 07:32:08 -0800 (PST) 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] drivers: scsi: qedf: qedf_main: Pass lockdep expression to RCU lists Date: Fri, 17 Jan 2020 21:01:24 +0530 Message-Id: <20200117153123.2648-2-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117153123.2648-1-frextrite@gmail.com> References: <20200117153123.2648-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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