Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1785705ybv; Sun, 23 Feb 2020 15:21:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwMvSNfgWzZEGPfU7mZKAbDgQuzf6S5SEBq/Y5aLqzeEpj60FaxbYip2cNRU4IExNNg9uGD X-Received: by 2002:a05:6830:1219:: with SMTP id r25mr13809677otp.180.1582500109896; Sun, 23 Feb 2020 15:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582500109; cv=none; d=google.com; s=arc-20160816; b=u8RgCAdR1+GuCSNQIx/U8yaVqxHZ+AlmBTTAfWZ78AOfLVBk7+n/1f5zlwFHz9C5fB 6poWCFfY1afYaZfj7M2If8VOpoZhuJDJ6aH3ryoD0KH9Bow3WwdoS6jMs7SuLL1cIM75 hoUhK0tddIcBW5xR6ka7ItbYpn/F2gKuFfLpA/jQINhb4Ouiv13AWvxmvovIY8+UA2Dx rneMrInGQctPahwcvq+DAmA8U0S76Nw+OvHmgr0ctgGCEmOlYoTFwYZhgdbFcxR4XczU jV0UdYGnJ3sPAIhUjemIB5zezJVzea90M6jZmWkN58GdZNM6Eos5+2IZzyMhCy+A99Sj /x8w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=m+LokEgk1OhCrIxCmqaU1nM/hbi0PMRKHeGZ/+qQiZ0=; b=p4a+Y8crm2p092f1ofYufWcLO/4YBwatyJHc4MFI9U6vjf8O9bRlHUrSNut/K5nJlR 5VWN0seBPcz6kISlBB8a/hACkCMzK+9C+JUMjGz8lqaDSoYR36ldANVhNY/bEgRy//6j a5f+l6bISECyaH2p5AjuKvzEGe20qyfwW6vsXxXMl9YDUhN2SRkfIEmx3gwgYNNmN7RT 5Kv7XcqtzhDo+J9r13F97TPYrs1wVcPpE2QbUNHMFe4kuc1gFlWXEeh6FzPYs55GAZdC HOsmGVXITeq9EmHIJiCQfjhHgICg8rVj2LqFm7GrYCJcVPUtHqdqy+ODYHh3o5Y3BHhj m+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WxJxvW7S; 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 t20si5191819otr.64.2020.02.23.15.21.37; Sun, 23 Feb 2020 15:21:49 -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=WxJxvW7S; 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 S1727244AbgBWXSA (ORCPT + 99 others); Sun, 23 Feb 2020 18:18:00 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36846 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbgBWXR6 (ORCPT ); Sun, 23 Feb 2020 18:17:58 -0500 Received: by mail-wm1-f68.google.com with SMTP id p17so7455460wma.1 for ; Sun, 23 Feb 2020 15:17:56 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=m+LokEgk1OhCrIxCmqaU1nM/hbi0PMRKHeGZ/+qQiZ0=; b=WxJxvW7S7Tz2b6SBXdAVYnjRHLSfa7FbKJLMOZlTGVrI2g01Fgn1qfwPi31Tpvxz/F mtoIEApfsV+vV4P6AYC2imNjwiPxX6kR/eq+B/kav2hBTYR5oSKABqpmoyQ+lVmrSH4H gmIEShzOYsMb7vB12RlsHijOgSMF9BXmKF2kmVPa/BylY5BEhJSGihsBdZb64/TwOS4/ zVcjeV9iHUfXWXFNF8JA7Ro20aRnz+nGYgEb7QNHoVj6FzDIfsWiJWTRsueCexqOUt4V lV4MeE9HuAoLj9oAbCXL8/3GSY6/+l8RzDyEKgSE2gaZFVg5X1z9CyJ0HpiGrNbgEP4s Sfkg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=m+LokEgk1OhCrIxCmqaU1nM/hbi0PMRKHeGZ/+qQiZ0=; b=Ck2/X8GTEenHY8FSNHrCmQY5tQ7Krtyz96zErLQtg79d0qh9kiQIvanx6G99QibUiv R3iBBZXys6GnQAtwSFbvOsiJWCNbZo2Hr+hnVeD/yWzIiJCEhjkHR9vjOXwlIRLnudhD 9gLLRT2qNYb82sSE0KxWkj86ZTEQ4oN9Y3bzne6mWw1q34nZsfDlSfjikVNc42J9GQmR AcgKBviyEuQrk7YasVVZFfGpkKCHFRdUnPcTfrxrZnB8DvGNi4x+nRiGw0UBSFhm3HQC iRH5jVASC1bHi2eQAAZGga2B2/jRPOZ0sm9+TerlOKJ4vGsjSAHsGX+krNjbSwj1cT+4 zlqA== X-Gm-Message-State: APjAAAUrT6T21OJYuXJRG7aQyDmbU317dHjZDMXlkEcJ9DPa7oERCe4p KdBgHmsSoyjWk3wHPk1tng== X-Received: by 2002:a1c:16:: with SMTP id 22mr18168884wma.8.1582499875389; Sun, 23 Feb 2020 15:17:55 -0800 (PST) Received: from ninjahost.lan (host-2-102-13-223.as13285.net. [2.102.13.223]) by smtp.googlemail.com with ESMTPSA id q6sm8968203wrf.67.2020.02.23.15.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 15:17:54 -0800 (PST) From: Jules Irenge To: boqun.feng@gmail.com Cc: jbi.octave@gmail.com, linux-kernel@vger.kernel.org, Dan Williams , Vishal Verma , Dave Jiang , linux-nvdimm@lists.01.org (open list:DEVICE DIRECT ACCESS (DAX)) Subject: [PATCH 02/30] dax: Add missing annotations ofr dax_read_lock() and dax_read_unlock() Date: Sun, 23 Feb 2020 23:16:43 +0000 Message-Id: <20200223231711.157699-3-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200223231711.157699-1-jbi.octave@gmail.com> References: <0/30> <20200223231711.157699-1-jbi.octave@gmail.com> 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 Sparse reports warning at dax_read_lock() and at dax_read_unlock() warning: context imbalance in dax_read_lock() - wrong count at exit warning: context imbalance in dax_read_unlock() - unexpected unlock The root cause is the mnissing annotations at dax_read_lock() and dax_read_unlock() Add the missing __acquires(&dax_srcu) notations to dax_read_lock() Add the missing __releases(&dax_srcu) annotation to dax_read_unlock() Signed-off-by: Jules Irenge --- drivers/dax/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 26a654dbc69a..f872a2fb98d4 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -28,13 +28,13 @@ static struct super_block *dax_superblock __read_mostly; static struct hlist_head dax_host_list[DAX_HASH_SIZE]; static DEFINE_SPINLOCK(dax_host_lock); -int dax_read_lock(void) +int dax_read_lock(void) __acquires(&dax_srcu) { return srcu_read_lock(&dax_srcu); } EXPORT_SYMBOL_GPL(dax_read_lock); -void dax_read_unlock(int id) +void dax_read_unlock(int id) __releases(&dax_srcu) { srcu_read_unlock(&dax_srcu, id); } -- 2.24.1