Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1895200ybv; Sun, 23 Feb 2020 17:51:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxDefMwRYeIqa2odag0kmnmijN9D42Dw9f/XKAmtWR9to2Zh+pCABDAeYTQHMq0nsLS1+us X-Received: by 2002:a05:6830:4b9:: with SMTP id l25mr17207189otd.266.1582509099259; Sun, 23 Feb 2020 17:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582509099; cv=none; d=google.com; s=arc-20160816; b=HmesndmYkhibMVYJyq73uNyqhFwX+1FULqYIbzgO4V3kNt6zwNyhfg3g7diaOnO84G JS1SEa2T42ThhoBlItCx2P/rV28yUdB8/XEL5tDbQEf68WxXdbHdz4tajs/RIyw/pyis IcUwLpXn7PDSAcPgR5zU9J8qmXb1jpKMtNhVD3Wj+AZB1uFP/lR981gqOPTdKwJb3mrP WQUuFj1i2gUkn3NJ/e7thy4r0BK1rEcbzSP6jZfNxqWvCY/X8Newx0LaSipKsRC20zxO HUrwvbGxZzhp63/ZDM4SGKov3w8qviDIVSpyDwnlZ//bbf6Knnh0uhO4WJB2yoJmZmQs tYlg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=nfdAonBHBDdIO56FXt/6K3IvqAFG9q35tqL/Ax7yCLk=; b=GpNWhx6J2on7TiHTVoN2b9Apgt0AyvmsdQQx7UrU5muFCP9ZwpOli/Cnfp9CDS2gqg fplo5mXszkUL/uu8ZsSBj+0frHq89oe5UXVAoL/7hEl3ox592N9m5xwAbGhC2rE3Pp9o p54XG9auOW7g1LgSYly8UKR9YX97+4SlXzoKrdSxcbO6EAnVyLk49QF2C5pC/Ff/REaG 7jYvqrl4TmK2YzOQ/3EqvSLZnZqI9fmSO5TqPXF9cxwqdXolF99a2DwFKQsLBCoT3nBG MhhOXGvoGM0Blx+XxcxqwkObRp1L0WxkLt7vEuu2f2cYE7B8UWpCY/dm2eyIZLX2LU0g cXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FFO+GTQR; 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 a22si5320362otp.84.2020.02.23.17.51.26; Sun, 23 Feb 2020 17:51:39 -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=FFO+GTQR; 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 S1727188AbgBXBvR (ORCPT + 99 others); Sun, 23 Feb 2020 20:51:17 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55526 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbgBXBvR (ORCPT ); Sun, 23 Feb 2020 20:51:17 -0500 Received: by mail-wm1-f68.google.com with SMTP id q9so7352368wmj.5 for ; Sun, 23 Feb 2020 17:51:15 -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:mime-version :content-transfer-encoding; bh=nfdAonBHBDdIO56FXt/6K3IvqAFG9q35tqL/Ax7yCLk=; b=FFO+GTQRYzvhCR/T9+OWH1M/t3DTcKoSYbe3tNNlO+4/iYItgFWLssom6rF8Xp9YL8 FxIOs3ucAdHWJObclb57laiH68CJjjRonzGzNSWiCQ/ESHEqfnKpwxZFfjpEupFud1Gh ScWU0ls2v0O4nQQImaNXlT+NkoNmtJKDBODogXyRBkFgjkWET9G11A95E8WFvbabMkKT 9rXEO9BXZPJFODc7CEd8pXl1KQuU8Kb3GqpOCwqpN8BcPH7Xx+UPCD5KKsaTfES7j0mA UeBHMq2Ab5fM0AceBfL3d0nyb19eoV8z4Uv4Tl07m86GL4c8Ymptqshgij9ep3Wd8xjI UgoQ== 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:mime-version :content-transfer-encoding; bh=nfdAonBHBDdIO56FXt/6K3IvqAFG9q35tqL/Ax7yCLk=; b=WAnxqJkfNtmrYkwhBjG3Ak316INrzTIoizCacvD5YfKlOfdtNfxr/V1DELs4ES7uIf ZIwPEEbweUQO2MKxEZHpq08kfSlU5KMlEJZj9C/lenZK0N8k7Uyi+lWcWX490DLfmNjY 7HLl12CArM7KQnyJfsMkyI+qHR2L+wifrIJKsho5RGGeSGCf/lIZUignuh0fC8YDTBn8 ScI5blUi5KilLt9xjYzbnGFEyv2qngKksOOlHln/fp5XqyVkAWlJXCyWz60OTUHZyyPB ydHq6QGNuYJPG3nrrixxMTVfi9DAtJKiO471shB9arG1UUOfHy+081zt51RQ3sHNQtJz lO0Q== X-Gm-Message-State: APjAAAWa4pRf28K3vzdhNvpSF0mTItXh9xybse8pAs12tYMms3tT6Wsy yk4MvldMHKmcVE0t1b14VA== X-Received: by 2002:a05:600c:114d:: with SMTP id z13mr18633181wmz.105.1582509074914; Sun, 23 Feb 2020 17:51:14 -0800 (PST) Received: from ninjahub.lan (host-2-102-13-223.as13285.net. [2.102.13.223]) by smtp.googlemail.com with ESMTPSA id q6sm9528128wrf.67.2020.02.23.17.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 17:51:14 -0800 (PST) From: Jules Irenge To: boqun.feng@gmail.com Cc: dan.j.williams@intel.com, vishal.l.verma@intel.co, dave.jiang@intel.com, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, yi.zhang@redhat.com, Jules Irenge Subject: [PATCH v2] dax: Add missing annotations for dax_read_lock() and dax_read_unlock() Date: Mon, 24 Feb 2020 01:50:49 +0000 Message-Id: <20200224015049.57556-1-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 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 warnings at dax_read_lock() and 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 missing annotations at dax_read_lock() and dax_read_unlock() Add the missing __acquires(&dax_srcu) annotation to dax_read_lock() Add the missing __releases(&dax_srcu) annotation to dax_read_unlock() Signed-off-by: Jules Irenge --- Changes since V1 Correct commit log typing mistakes 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