Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp389876ybv; Wed, 19 Feb 2020 01:36:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwIU/bFT2gOzgB2hBN2jWPeJ7hXnP7lLjza2c+fh8gHyzfEyxF8nFzygf8CFJ67roD0TycG X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr19616999otc.186.1582105004218; Wed, 19 Feb 2020 01:36:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582105004; cv=none; d=google.com; s=arc-20160816; b=MvXB863+3sXCI3vgW9s7cL4/RzwfAit11J8dS7E2+WCJRLb7W3rYZcj2R+A6a3OqeQ xk+eOzvzXeAZyqF5n9EeC4MRnWCoCu6+TVG4TdGmJzRUoj5hX5+UH63+j5Qx2i+4MEe8 Jh/Intupwd92C0e+TgX4lMljU/nB+vG/Byh54Fkqj6u9jncqrb0Mb4o+drgYEqjPvgWP IkjN//wsAbfI17+Ec0uZfGzrX6hu6amOvSKSuCx5Kd9gDf+LnjiNSDFZvwfD+7KPo8/f 7FljDDCSCwL4KEaIsDhdL2FGUjAmnQbVg6+sLw8AVm8MHvBe36U+gFowCROnrt6CftOR J+eg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=USv22fMY4lRbm7kdOlrco6KeUFWgxCIZrYv0NUecR8k=; b=evKJeR5sGEmFbh/ZZHlu+7QTLwzkxEYqaSWIuQBeS5YlQXqbFCZpkw8qB3Eo8SaTcx 3U5VfY9/sjePfi40jvgewtFdyu2mzqFWUDjHf9Qk5/OOg6dFCYOcPLamNw6fQ86Nr2vs qQBzaJgNKACI1HcK+eH8lSGJzo49tiBYIqxTKO3aCDd6+fiwv3yro/eqQehSPYgtzryX uMcOHOhWtly3cAyE3JZSg/5MKuHcdB1qDJgzELEBhlaNGDmApewtjYHxkXH4uIH9iyPJ uZvGKd0XCGk/WDlx+NCDYsQB+KYDzGA1w7uK1C0iQpLfV9mWjVpWEM1aAqvJQNda865h Tw2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mFl+Rpgh; 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 a64si9595699oif.256.2020.02.19.01.36.31; Wed, 19 Feb 2020 01:36:44 -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=mFl+Rpgh; 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 S1726605AbgBSJgJ (ORCPT + 99 others); Wed, 19 Feb 2020 04:36:09 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43665 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgBSJgJ (ORCPT ); Wed, 19 Feb 2020 04:36:09 -0500 Received: by mail-pl1-f193.google.com with SMTP id p11so9318959plq.10; Wed, 19 Feb 2020 01:36:08 -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:mime-version :content-transfer-encoding; bh=USv22fMY4lRbm7kdOlrco6KeUFWgxCIZrYv0NUecR8k=; b=mFl+Rpghcx4xs9gygrl7xbkfupYFtIeXXg7A2VrlMXSkKuMQsWKeCG26GbJDCiOieA OjvFeZpZfmYjIpBwwOBC9csCzviJo3jbxes07OuwfMKnYxJUcVKvyfaQepkrHlLQx9es OV7Iu2BxOSRlY1uWn0azWWlBlxhrfAL1rnIEVUnSViqd4vKaKk30ZnHvziLZcbICXXdJ rLShTFl9eQRoiKGW0P2xPeeBunLdmhwGgSpuuQMZFkTJMTClvncjNGMTqkyzJhTPZ7l7 bVuNYv9kA+TX8kwieNjO4JqyjO3IVcfqL78VqmZ1CUZaxtive881yHsaUaEmaKDPtOo0 yKTw== 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:mime-version :content-transfer-encoding; bh=USv22fMY4lRbm7kdOlrco6KeUFWgxCIZrYv0NUecR8k=; b=BnqxSqgb2PCsdaQaiqsFx6PyJxYz4A8QlguJcIIK6LB6qseV1pRAe9qC/opNUtm1/Z q2kTuAS1gmtlSj2KUBi2npYm/ys6/JvmZ7NUcjc9xk74+S5A4A7hXxwGpY+HEzjbOdXU hVpa5xxZ+PwoYXsJOar9WFMD7nIGFDkxLopYce2iXGl7IbJrFEqq8LTe++FQVnz8ltpL XFbveUc9719dJSVdDnIdYe6b7fL7GeVPKbtt0xmamfoSMCDmVCV8l3LWSGX3SWDCw2k6 OEsOgjkf8Fyyc6I4WByIQAnXT2hwcmaajRqP94bct8GfUzEK6+X/QPiXoGJyhVeumOXi EyZQ== X-Gm-Message-State: APjAAAUMbtOMaR3X4PdQv3XPBrbLxvQYFqeT2wgZeNDX2PO0vOqHDZ73 i/zFEE4z/nfH3RIHD1KkySQ= X-Received: by 2002:a17:902:9a09:: with SMTP id v9mr24385277plp.341.1582104968248; Wed, 19 Feb 2020 01:36:08 -0800 (PST) Received: from localhost.localdomain ([146.196.37.220]) by smtp.googlemail.com with ESMTPSA id x197sm2119217pfc.1.2020.02.19.01.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 01:36:07 -0800 (PST) From: Amol Grover To: Trond Myklebust , Anna Schumaker , "J . Bruce Fields" , Chuck Lever , "David S . Miller" , Jakub Kicinski Cc: linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, Amol Grover Subject: [PATCH] sunrpc: Pass lockdep expression to RCU lists Date: Wed, 19 Feb 2020 15:05:05 +0530 Message-Id: <20200219093504.16290-1-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 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 detail->hash_table[] is traversed using hlist_for_each_entry_rcu outside an RCU read-side critical section but under the protection of detail->hash_lock. Hence, add corresponding lockdep expression to silence false-positive warnings, and harden RCU lists. Signed-off-by: Amol Grover --- net/sunrpc/cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index f740cb51802a..5db5f5b94726 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -97,7 +97,8 @@ static struct cache_head *sunrpc_cache_add_entry(struct cache_detail *detail, spin_lock(&detail->hash_lock); /* check if entry appeared while we slept */ - hlist_for_each_entry_rcu(tmp, head, cache_list) { + hlist_for_each_entry_rcu(tmp, head, cache_list, + lockdep_is_held(&detail->hash_lock)) { if (detail->match(tmp, key)) { if (cache_is_expired(detail, tmp)) { hlist_del_init_rcu(&tmp->cache_list); -- 2.24.1