Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp542153imm; Wed, 20 Jun 2018 02:35:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKEY4goxtsl4ZoKM1VjJCKKEEJrCeNBj8/TMHlJJQYijuhYuAuH1hVyxzka5cOvQWjPPl6a X-Received: by 2002:a65:5003:: with SMTP id f3-v6mr17928485pgo.425.1529487340343; Wed, 20 Jun 2018 02:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529487340; cv=none; d=google.com; s=arc-20160816; b=X5MmLlfQ1oLSW1CHtQc0r3tpoUPqpV1A4Z8dfUZaeWp6M4yY5GngxQUqZf6phCgb2h MW/YwZma5bxQx3L4tdeJXIblIxS8LPe7efV/8v3/aYhcUAlyfAufvT6JQAgYV5BqnIQt V+Hu3nmH00sJHjNjqSvjLqcpXJ28bdYwzjkqOykx3803oiB9qrPTHi2BTDZsbgYr+9/J bI3QyDHXIBzPsl0GEuyEmBbToSEKJNZEZZOmGSLuPl/W4Npc3xZ3ZGDOlJiziFy4Alle HGnAggcS4p1WcUaEuJhVD4/ok7STJNFhUjbpFgW0A48Rppd7t144kpJvfocj9mPD1xbF 90LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=R+Dq2oVGGXF/6l5VuSOyZPiQZmxtqeJTw48n4Fa/R9c=; b=cTASEK/B7jAlxoJtfW3I57Sbp303vwHpKCd82bLbcvDi4FwWiJUMxlr8H5PaIKSzrX F78KsX5x/zZraMtkye8kUQyL56ynTMeLzFVX9e9bMIdYa/1s3mXqZ0EkwUzJy9giAEby snNGVI8yGQ0mZUSgjklYuBtLah5N4hG6erITNO8lXI1kwihgAPCyRiiv59mkhNNGYiP2 sjbICzyjmjko7fq7UlfIy+gneIKAl9dmDGS16VOFhjmq0+0GyWn/M4Xfoq/tZ+ifK1Ed VH7KXabdLvKRclSsGmVBxKwSjTBg/O3GE0u2hGaOTdSgQSUrFe5pQdb8Iugv63QdSQEI y/Gg== 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 n10-v6si1711868pgs.485.2018.06.20.02.35.26; Wed, 20 Jun 2018 02:35:40 -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 S1754757AbeFTJet (ORCPT + 99 others); Wed, 20 Jun 2018 05:34:49 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42273 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517AbeFTJeo (ORCPT ); Wed, 20 Jun 2018 05:34:44 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5K9XrLL3447126 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 20 Jun 2018 02:33:53 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5K9XpFd3447123; Wed, 20 Jun 2018 02:33:51 -0700 Date: Wed, 20 Jun 2018 02:33:51 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Waiman Long Message-ID: Cc: dave@stgolabs.net, arnd@arndb.de, linux-kernel@vger.kernel.org, g.schenk@eckelmann.de, peterz@infradead.org, tglx@linutronix.de, longman@redhat.com, mingo@kernel.org, hpa@zytor.com, dan.j.williams@intel.com Reply-To: dan.j.williams@intel.com, hpa@zytor.com, mingo@kernel.org, longman@redhat.com, tglx@linutronix.de, peterz@infradead.org, g.schenk@eckelmann.de, linux-kernel@vger.kernel.org, arnd@arndb.de, dave@stgolabs.net In-Reply-To: <1527168398-4291-1-git-send-email-longman@redhat.com> References: <1527168398-4291-1-git-send-email-longman@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/urgent] locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS Git-Commit-ID: 03eeafdd9ab06a770d42c2b264d50dff7e2f4eee X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 03eeafdd9ab06a770d42c2b264d50dff7e2f4eee Gitweb: https://git.kernel.org/tip/03eeafdd9ab06a770d42c2b264d50dff7e2f4eee Author: Waiman Long AuthorDate: Thu, 24 May 2018 09:26:38 -0400 Committer: Thomas Gleixner CommitDate: Wed, 20 Jun 2018 11:29:23 +0200 locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS It was found that the use of up_read_non_owner() in NFS was causing the following warning when DEBUG_RWSEMS was configured. DEBUG_LOCKS_WARN_ON(sem->owner != ((struct task_struct *)(1UL << 0))) Looking into the rwsem.c file, it was discovered that the corresponding down_read_non_owner() function was not setting the owner field properly. This is fixed now, and the warning should be gone. Fixes: 5149cbac4235 ("locking/rwsem: Add DEBUG_RWSEMS to look for lock/unlock mismatches") Signed-off-by: Waiman Long Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Tested-by: Gavin Schenk Cc: Davidlohr Bueso Cc: Dan Williams Cc: Arnd Bergmann Cc: linux-nfs@vger.kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1527168398-4291-1-git-send-email-longman@redhat.com --- kernel/locking/rwsem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index bc1e507be9ff..776308d2fa9e 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c @@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem) might_sleep(); __down_read(sem); + rwsem_set_reader_owned(sem); } EXPORT_SYMBOL(down_read_non_owner);