Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3004270imm; Sun, 1 Jul 2018 10:06:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9bXq0rvMfdZjMogEwkbBN+kUxJctErmgEF5OfDNtba6tGsPM36S1uJbcsTtLCq1uQpQDD X-Received: by 2002:a17:902:8685:: with SMTP id g5-v6mr6865133plo.180.1530464806676; Sun, 01 Jul 2018 10:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464806; cv=none; d=google.com; s=arc-20160816; b=OfjChPQghPu9eMLNu02H4DDawy45kh/pIG88H6w0VJGlKwOP/CEsc1rEx6KpiMk6zB q4uYsv8g3iIbpZoS9EXxn9Nbe1DVQ4cF/YRmNs8J8uS1aIsQ8xF14SaKnKPPLFBD4nTa NWxKy58HQ1NftewI1lqJRekhzM6/I1t4mIqWagwfZeDxtkdvAdLwWFuGCsZRVjIMHGcM hI1H2wKpLVveYyfRoW37Pivsc6FXxEZR6X1oPnpiSd/23SNoOOMx7Nh5BOMprfGd/Cf8 YZooavm/AdMUSglgvJwG2UBjyZD8MhkmcGoHTkorfs+yFa+Hdpbg/Z8O7ccKjEitI1Ms pY4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=g/8fqTM/yygyviUZy0CSgyetZyXEPNgOw4ZS/nylG9I=; b=Or7EU3uKWydx+c2qXNVa4klvRLnzdZGwcRQ7UkZzPsP9mIRQ0o9fycwv0FOAJ/4plN 6Ca5BvVcSFeRkZBVfZU+Yw5FrwtDfD3ZGicYSsB010rMLazcJ1vbdoZNn1WFYW71E10K ko3SJ/9mbJa5pWZk7+pCPGF/2seOmIJXryPFNzkFQN1tquOz5+KVBxg6edlOii7KlIOL F2qiBvP+gnlLgd1PWZcUGQb0Z6kr8bNStasZDIUTcwjD9kkDOHENYl38O881/ojouj0g GMGa8O8X7BncyEWUOWOmaW+kFjnNJ7Rug4rQof5UErbVn5BcuFYyxPJu7R9B9Wkhsgpv CkTw== 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 h4-v6si12108749pgp.490.2018.07.01.10.06.32; Sun, 01 Jul 2018 10:06:46 -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 S1032177AbeGAQmY (ORCPT + 99 others); Sun, 1 Jul 2018 12:42:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37602 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031929AbeGAQmS (ORCPT ); Sun, 1 Jul 2018 12:42:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 573D6ACC; Sun, 1 Jul 2018 16:42:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Waiman Long , Thomas Gleixner , "Peter Zijlstra (Intel)" , Gavin Schenk , Davidlohr Bueso , Dan Williams , Arnd Bergmann , linux-nfs@vger.kernel.org Subject: [PATCH 4.17 126/220] locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS Date: Sun, 1 Jul 2018 18:22:30 +0200 Message-Id: <20180701160913.605670833@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Waiman Long commit 03eeafdd9ab06a770d42c2b264d50dff7e2f4eee upstream. 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 Signed-off-by: Greg Kroah-Hartman --- kernel/locking/rwsem.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c @@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semap might_sleep(); __down_read(sem); + rwsem_set_reader_owned(sem); } EXPORT_SYMBOL(down_read_non_owner);