From patchwork Fri Oct 14 23:58:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 13007528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E8B9C433FE for ; Fri, 14 Oct 2022 23:58:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1DE16B007B; Fri, 14 Oct 2022 19:58:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DCE076B007D; Fri, 14 Oct 2022 19:58:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C97066B0080; Fri, 14 Oct 2022 19:58:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B8C7E6B007B for ; Fri, 14 Oct 2022 19:58:23 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8CB201202A4 for ; Fri, 14 Oct 2022 23:58:23 +0000 (UTC) X-FDA: 80021221686.04.A7B8C82 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf18.hostedemail.com (Postfix) with ESMTP id EFB3A1C002E for ; Fri, 14 Oct 2022 23:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665791903; x=1697327903; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=K1aq+/q+FuOiZcIjOjX1lseJ32olR7LP6wPKxMz7epE=; b=UrrbnQnCjfG9Mv9/tRt/avZnmhqzQDYB9JRO7kr7NetBrpnHGhcbtvLa CbOZ59i5nNzrBMLJ7NZa20wYW6GX2a99y7l75AEK0u6Nx9SqzebGt/zdO ibDnAHXyVG9vAauqWHHdSYRH0336feUCsbHKPfZHjhl4M3rskYV8YZftK OHo+lbY+/wmZc/QBlSBorELjEUmKGs9SHcnl7XT/VyGIOSKTRBexZ6AFd XUZp2wGuyHaXGRUowDV+uVbmaO8zOLMyiK/2f6HA2DJI8DWAZTWsfH9fB gra/v6+G5nuaA4a1UCvq0sHcdzBTtNzvBMAwHu/96JyVzVZd2hljIAnsm g==; X-IronPort-AV: E=McAfee;i="6500,9779,10500"; a="391802471" X-IronPort-AV: E=Sophos;i="5.95,185,1661842800"; d="scan'208";a="391802471" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 16:58:21 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10500"; a="630113492" X-IronPort-AV: E=Sophos;i="5.95,185,1661842800"; d="scan'208";a="630113492" Received: from uyoon-mobl.amr.corp.intel.com (HELO dwillia2-xfh.jf.intel.com) ([10.209.90.112]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 16:58:20 -0700 Subject: [PATCH v3 14/25] devdax: Fix sparse lock imbalance warning From: Dan Williams To: linux-mm@kvack.org Cc: kernel test robot , david@fromorbit.com, hch@lst.de, nvdimm@lists.linux.dev, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org Date: Fri, 14 Oct 2022 16:58:20 -0700 Message-ID: <166579190012.2236710.846739337067413538.stgit@dwillia2-xfh.jf.intel.com> In-Reply-To: <166579181584.2236710.17813547487183983273.stgit@dwillia2-xfh.jf.intel.com> References: <166579181584.2236710.17813547487183983273.stgit@dwillia2-xfh.jf.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=UrrbnQnC; spf=pass (imf18.hostedemail.com: domain of dan.j.williams@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665791903; a=rsa-sha256; cv=none; b=xZl6bT2fJ13O659ZML36hlUmludGo+EAeOW+dZn7v34lD/9wcyJ6OklsYt4JmfbTEivPiq FBlrfsNP9v0/wqtWAQud0z0N92s8dJfohUYYDjAWCxjh+Zl9fnW/ruu2k/vJ4ucq6dXsX+ pIImPtpwRfxO75+wQh6cgxAc1ptYuho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665791903; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UnjebZAuCbgnprXpdgXqU6XmMa/hB1k8NyCRvHAm6xw=; b=LEfqN5VHkQsy0+AxLq7e3E9dI5upDgauqR0zbK+KMJY6prcE4By3r4QpZaEt+pTtU33Cqj 0emIEEBypkU/1xI2nuJKwEH+UuXTYe/G4fXnhmKfIBYE60Qx8E0nylo/cVA4vPMg/1AOHL OsUDvu/LN/KQKpq0X5LNuTM5OKEp00U= X-Rspamd-Server: rspam05 X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=UrrbnQnC; spf=pass (imf18.hostedemail.com: domain of dan.j.williams@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Stat-Signature: 34gt8dfx6eqhsrctqunrbhqjp1pyudtd X-Rspamd-Queue-Id: EFB3A1C002E X-HE-Tag: 1665791902-795430 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Annotate dax_read_{lock,unlock} with their locking expectations to fix this sparse report: drivers/dax/super.c:45:5: sparse: warning: context imbalance in 'dax_read_lock' - wrong count at exit drivers/dax/super.c: note: in included file (through include/linux/notifier.h, include/linux/memory_hotplug.h, include/linux/mmzone.h, include/linux/gfp.h, include/linux/mm.h, include/linux/pagemap.h): ./include/linux/srcu.h:189:9: sparse: warning: context imbalance in 'dax_read_unlock' - unexpected unlock Reported-by: kernel test robot Link: http://lore.kernel.org/r/202210091141.cHaQEuCs-lkp@intel.com Signed-off-by: Dan Williams --- 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 4909ad945a49..41342e47662d 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -42,13 +42,13 @@ static DEFINE_IDA(dax_minor_ida); static struct kmem_cache *dax_cache __read_mostly; static struct super_block *dax_superblock __read_mostly; -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); }