Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2794746imm; Thu, 24 May 2018 16:21:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZolQTtC051tQm8bo/APyjJE+d5Dqid4W18kA7cyfidX0OnHt29Vc0b3hWDyzCMxhd8v6RxJ X-Received: by 2002:a63:7904:: with SMTP id u4-v6mr916pgc.143.1527204085551; Thu, 24 May 2018 16:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527204085; cv=none; d=google.com; s=arc-20160816; b=K/5mfA5Gj725skzqVBQQsTi3KVyQXu2gzSe/1a+LNW+0kQbC+bvq+oXfRfhheYqhL5 ALaQ3FVRvgRt4l2PHS722P/4QUMgJqGrHZ/LQw+ElGNqOtcMP9nyTocSe2q6NZn7nJB8 beBs2rRmSDlD0UbbOiR5dp1e5XsOBqWcwiOLFSFZ3BZOM4CcOko9kmk7fUaqLDSJnMNS DAPYxZ2FpMuIsPVW4/SPnBU60jCTIEP/U8uob+9X/MG0QGQwBkGFqk/N6DsXp1S3DtVV Cadtq8/EwfXlJohnKZywsTekgKUUVUq8J6U5HSQPjwJSkMkLY+qoB147WiIQw+dzTxoM ubQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tnymfCXyR8XmvwApZq+y1AYWx9sAuMVfYZUS2tl5KSI=; b=ORNl5lUEgRvzt2CpMX+iQYlBWuQeLgP8JIRwrvqYWrdXISIn6asMxqzaKuVfh1DQVa G8ppkKt7yCp3TewfFAAn9DdTLvtDVPhkCJCKKuObpZFd0ytdAByyqdFd1Gz1gspa084Z wLOXLlK5KdGW9CdJypAgbsuwhizPHwKkhm9/aKOhVSoGaTj/SWvLLqBY2izUZtnyJxp3 9exuBtk5Ni9MDpVHpHWXDXq0uvm62fRUCWy3kaNUZsBNgE9ikK8X6zBMqvBtgWBO/lOp zNVNGBRPNDkeUJOGE3u8U+ox/1nfNpwVvFEzOry1rVGQUY1pq3DGnKR5V/5loGUc2CKa qLCw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a98-v6si22063110pla.239.2018.05.24.16.21.10; Thu, 24 May 2018 16:21:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755116AbeEXN1B (ORCPT + 99 others); Thu, 24 May 2018 09:27:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40426 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755082AbeEXN0z (ORCPT ); Thu, 24 May 2018 09:26:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1C1580401A8; Thu, 24 May 2018 13:26:54 +0000 (UTC) Received: from llong.com (dhcp-17-81.bos.redhat.com [10.18.17.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5EA6111762F; Thu, 24 May 2018 13:26:51 +0000 (UTC) From: Waiman Long To: Ingo Molnar , Peter Zijlstra , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Davidlohr Bueso , Dan Williams , Arnd Bergmann , linux-nfs@vger.kernel.org, Waiman Long Subject: [PATCH] locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS Date: Thu, 24 May 2018 09:26:38 -0400 Message-Id: <1527168398-4291-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 24 May 2018 13:26:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 24 May 2018 13:26:54 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Waiman Long --- kernel/locking/rwsem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index bc1e507..776308d 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); -- 1.8.3.1