From patchwork Fri Oct 14 23:58:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 13007535 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 486B9C4332F for ; Fri, 14 Oct 2022 23:59:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0DB06B008C; Fri, 14 Oct 2022 19:59:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBE356B0092; Fri, 14 Oct 2022 19:59:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B83DF6B0093; Fri, 14 Oct 2022 19:59:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A68586B008C for ; Fri, 14 Oct 2022 19:59:06 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7B1B51202A4 for ; Fri, 14 Oct 2022 23:59:06 +0000 (UTC) X-FDA: 80021223492.08.B049BCF Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf15.hostedemail.com (Postfix) with ESMTP id C6C8CA0027 for ; Fri, 14 Oct 2022 23:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665791945; x=1697327945; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=utXjDwHtVMO/W0wdDgPICi14CmGCX+3qR5RCZ+LxUbs=; b=ehmvPVGGIxKjst1QZp7Bm6K7HgniN8rnXun/radGnEzv2/2qMoq95QLi 6fa4c9xjAOJUkB5EQvh5Ph4F0XZpOQ+B07QqlHxBZEeYBesHwGito6MLE JQUwpLoDLK3J0kEh4dX1NNakK1FOmT+PWUa72rjXOK87YDW+Vrw7b7Dok qGS9viJ0crEMiq5a/VCYycTzyiAqbp8K8sddQnVoN69Ctme6jy0wck6kh UVfG4+sbOUCHSDSKMnQromCOUlgl6GB2TwL/7iye2IzgAhGGnINgQ5aq6 pjPVsVgt8kxVCyUGHor0wTXqlQkLeV4gI1IkoRZOTgMZP62hx1OIyMkqm w==; X-IronPort-AV: E=McAfee;i="6500,9779,10500"; a="288791438" X-IronPort-AV: E=Sophos;i="5.95,185,1661842800"; d="scan'208";a="288791438" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 16:58:38 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10500"; a="802798941" X-IronPort-AV: E=Sophos;i="5.95,185,1661842800"; d="scan'208";a="802798941" Received: from uyoon-mobl.amr.corp.intel.com (HELO dwillia2-xfh.jf.intel.com) ([10.209.90.112]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 16:58:38 -0700 Subject: [PATCH v3 17/25] devdax: Sparse fixes for xarray locking 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:38 -0700 Message-ID: <166579191803.2236710.11651241811946564050.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; imf15.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=ehmvPVGG; spf=pass (imf15.hostedemail.com: domain of dan.j.williams@intel.com designates 134.134.136.126 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=1665791946; a=rsa-sha256; cv=none; b=PUrhIs0BRmlQivrOKZESuI6rXTL9mGTMhYsxn7TphyIGqTcJH3bHyWjgD7wMIa/37aiNw5 gaKUp2MsWF+85XgEWseyFHXhoQVyqq6REFFRMxRGFUEnRRucvsOwTtB0m7En3SDoPumPYM +LOKQLkm5Wo9ZDCbCNmVNhRchX5MYAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665791946; 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=WKHxpYWw6Kh9khzrA0oHqDikhQlvjbtqNhVNH2uPI5s=; b=nZ6JYs2DJihQ/qpahkxaNJ5ibKOX0Ndu3j7pZ7q/4uAp/gJWko0vCja5K04i11Sb63DM3k gvhC028PPEhNR7ii5t5RnCXcySWNKAG0EPgkW8QOMLKdOkcbTN/R9pAKyJ42uHH1SS3A6T ZFSajMmnAJwhztvofeoRrPe6wjt+Jtc= X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=ehmvPVGG; spf=pass (imf15.hostedemail.com: domain of dan.j.williams@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C6C8CA0027 X-Stat-Signature: epcxutp3ru8j3e8ocqumzcc3wdptdcen X-HE-Tag: 1665791945-641937 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: Now that the dax-mapping-entry code has moved to a common location take the opportunity to fixup some long standing sparse warnings. In this case annotate the manipulations of the Xarray lock: Fixes: drivers/dax/mapping.c:216:13: sparse: warning: context imbalance in 'wait_entry_unlocked' - unexpected unlock drivers/dax/mapping.c:953:9: sparse: warning: context imbalance in 'dax_writeback_one' - unexpected unlock Reported-by: Reported-by: kernel test robot Link: http://lore.kernel.org/r/202210091141.cHaQEuCs-lkp@intel.com Signed-off-by: Dan Williams --- drivers/dax/mapping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dax/mapping.c b/drivers/dax/mapping.c index 19121b7421fb..803ae64c13d4 100644 --- a/drivers/dax/mapping.c +++ b/drivers/dax/mapping.c @@ -213,7 +213,7 @@ static void *get_unlocked_entry(struct xa_state *xas, unsigned int order) * (it's cycled in clear_inode() after removing the entries from i_pages) * After we call xas_unlock_irq(), we cannot touch xas->xa. */ -static void wait_entry_unlocked(struct xa_state *xas, void *entry) +static void wait_entry_unlocked(struct xa_state *xas, void *entry) __releases(xas) { struct wait_exceptional_entry_queue ewait; wait_queue_head_t *wq; @@ -910,7 +910,7 @@ vm_fault_t dax_insert_entry(struct xa_state *xas, struct vm_fault *vmf, } int dax_writeback_one(struct xa_state *xas, struct dax_device *dax_dev, - struct address_space *mapping, void *entry) + struct address_space *mapping, void *entry) __must_hold(xas) { unsigned long pfn, index, count, end; long ret = 0;