Received: by 10.192.165.148 with SMTP id m20csp305502imm; Thu, 3 May 2018 20:56:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrz5QZLGRKTHJSqO7WfShfQUs2JBFsMXj3kCIg7iSpjY4hVhkb+Fz16jJSq/L8BhrDvXcrS X-Received: by 2002:a17:902:8f93:: with SMTP id z19-v6mr11349334plo.166.1525406181110; Thu, 03 May 2018 20:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525406181; cv=none; d=google.com; s=arc-20160816; b=wOjOxjM/S1V7jw+GHASo+yN9rZMq/4cRGVcLIm4NMRBf0v9frX44tLt/uH8M9cf3xN PyT+xKnvNcnU8V1UdJKpoF3qKZ8r2UcWfCU5ijNigyx2yq/f6NeLdvUvf250u0wYX12+ RssykWZqt2la4PJQ8uzJbRRsdk3LoR1wViT0Hs4+sno35gtAsJ1lM16pc+4ri280FWEv Sqa3r34xdNCzJoxetZTJP3Nbpsb8/0UxkO96++uqvhay4Z3D0ex0zJf2EkDzQ8sK/+NI ULL4NJ/SG48UwOdcwDEYCZJV5C4jY25oxvePc4g8pJp8pdTNoAMkjhnHUA57+432+WgU 1/dA== 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 :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from:arc-authentication-results; bh=CvGXzvlXGXPQe7zSbDm2aJ5vEu2mMY4VttxiE2kqIbg=; b=0cLeKKB38Flpw5j+MbL9g7IyH2xrC2txQqq0uU/X1vkJ0HABDCV2v9SSSVDbtRLBVU ifGnbdFUkL13SxZQfh9n2Wij7l+wXObeagCEoYv9Th8hmkZPmbSkFJHA5qW64NntVBy5 5g1Xw9//3WppO3yUP6E3/jI4DhuZTUlbwFAEEFkYfVK/rDXB0dN2VEW0R9CyB3GcjVV2 8MZF6/2Nurq7iMFDM73qqdsQgN8zR8EeFHskw5HH7j4eyjViSCGiSLJTIEY1p6Xwgiqi TbfQGhMI6MXeVIT66xUX5/FVn3jevXtztl0aLSnshwQVngCSVUhWok+1xHJejC5vqT8I jMQA== 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 d8-v6si12145028pgn.428.2018.05.03.20.56.07; Thu, 03 May 2018 20:56:21 -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 S1751360AbeEDDyt (ORCPT + 99 others); Thu, 3 May 2018 23:54:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:44946 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbeEDDyr (ORCPT ); Thu, 3 May 2018 23:54:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 81295AD0C; Fri, 4 May 2018 03:54:45 +0000 (UTC) From: NeilBrown To: Thomas Graf , Herbert Xu Date: Fri, 04 May 2018 13:54:14 +1000 Subject: [PATCH 1/8] rhashtable: silence RCU warning in rhashtable_test. Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <152540605424.18473.310003836978239224.stgit@noble> In-Reply-To: <152540595840.18473.11298241115621799037.stgit@noble> References: <152540595840.18473.11298241115621799037.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org print_ht in rhashtable_test calls rht_dereference() with neither RCU protection or the mutex. This triggers an RCU warning. So take the mutex to silence the warning. Signed-off-by: NeilBrown --- lib/test_rhashtable.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index f4000c137dbe..bf92b7aa2a49 100644 --- a/lib/test_rhashtable.c +++ b/lib/test_rhashtable.c @@ -499,6 +499,8 @@ static unsigned int __init print_ht(struct rhltable *rhlt) unsigned int i, cnt = 0; ht = &rhlt->ht; + /* Take the mutex to avoid RCU warning */ + mutex_lock(&ht->mutex); tbl = rht_dereference(ht->tbl, ht); for (i = 0; i < tbl->size; i++) { struct rhash_head *pos, *next; @@ -532,6 +534,7 @@ static unsigned int __init print_ht(struct rhltable *rhlt) } } printk(KERN_ERR "\n---- ht: ----%s\n-------------\n", buff); + mutex_unlock(&ht->mutex); return cnt; }