Message ID | 20240208184913.484340-10-mathieu.desnoyers@efficios.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 41096C4828F for <linux-mm@archiver.kernel.org>; Thu, 8 Feb 2024 18:49:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F9726B0098; Thu, 8 Feb 2024 13:49:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 733596B0096; Thu, 8 Feb 2024 13:49:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E9866B0095; Thu, 8 Feb 2024 13:49:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 39D7D6B0092 for <linux-mm@kvack.org>; Thu, 8 Feb 2024 13:49:29 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0EACF8069D for <linux-mm@kvack.org>; Thu, 8 Feb 2024 18:49:29 +0000 (UTC) X-FDA: 81769524858.03.E1ABBFF Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf02.hostedemail.com (Postfix) with ESMTP id 64A2F80006 for <linux-mm@kvack.org>; Thu, 8 Feb 2024 18:49:27 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="vtjc7/2f"; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf02.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707418167; a=rsa-sha256; cv=none; b=hu1WznAaos6QlMudnsMejho19FHcSIr5ShIhfZG7R0DOZ5OVBaduI4/gEXhlTz1oy9HXIg qlHgT7ovTQgwefOuPH3HmBQ5dSfr9S2bdGHELKlkYmotKNG2544j3tb46m2Qqz7XVD5Q8W kYJhdhr6XS1z3PFEJDbVcfvS7/j+bs8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="vtjc7/2f"; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf02.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707418167; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=l2wRmrDvqQckE3o82F7VoUp3GeHgriJVil7x/mcQt2I=; b=5FlpQtjxrIDHz/oTo6PC3r2ycdZEfhwrUCyKsMbAtCCHVoZ8iqh5pwGave3MjWWMURhl1U 2DCJTwJ3rFQW1/A6crB4p7xVP598UHmrAdvgNUeRRIZ1ALeWufVP5rImbxTgdSMI7RFITH Ezdc1k54xWcxbG0j9z93pNSHvseKGiU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418166; bh=Iy1T66BEIuPj6bTS95Nd9D5h8aE2OAfCM3Sw4sgOgjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vtjc7/2fYgtbG9L3HmHuiZ0hGJa5dwKDXt/n16lAht+M2tw/jI1e25yKjrmZukvCz /CX1mCneF7UyCbUOI4h3G4fdzzSb+li471Gx6ba8eevnycoFnHMSk9/h7wbWMnbYvz 6nZtKBy7/E8bqAxj2lbFepGPrzFubBQ+wr2SChDD6HS2Wn+qRldp0qwKKSKFtnBJIU OLFpBjTdvJMQftoRrtnmWegJrS0zZtCdd9sUdS3eoFkCZdZGdSYOE7mkXPbWW5GCXd tkUbHVYezf/E/8BNNB/B1FE4KQJPivjjt8+FxxLo9L9C6/i/PG/zlxN+sluj3adEJD E0pl1Ko8zJjwg== Received: from thinkos.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TW5ck2DcczY2L; Thu, 8 Feb 2024 13:49:26 -0500 (EST) From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> To: Dan Williams <dan.j.williams@intel.com>, Arnd Bergmann <arnd@arndb.de>, Dave Chinner <david@fromorbit.com> Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, Vishal Verma <vishal.l.verma@intel.com>, Dave Jiang <dave.jiang@intel.com>, Matthew Wilcox <willy@infradead.org>, Russell King <linux@armlinux.org.uk>, linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, dm-devel@lists.linux.dev, nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, Alasdair Kergon <agk@redhat.com>, Mike Snitzer <snitzer@kernel.org>, Mikulas Patocka <mpatocka@redhat.com> Subject: [PATCH v4 09/12] nvdimm/pmem: Cleanup alloc_dax() error handling Date: Thu, 8 Feb 2024 13:49:10 -0500 Message-Id: <20240208184913.484340-10-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208184913.484340-1-mathieu.desnoyers@efficios.com> References: <20240208184913.484340-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id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/9oDfnTx4bUqhvSR0u5Jf5cW8129pTtj0qj9pFsUIhRWfoMFQpCVSQ/77RuGrcT/k+6gtQzA+vrDUwJDAP4ZgtWCCg+HLYMEHk8Q56Nv+8fvu9yUIF5Zd8FZJaC1Jorwv+6GiFL1Czlgx9qcSHfW5G8hfUb6FNtY0y4PQi6vd9SogasIrEep7jxXVdqEthpUEJYFRJqNlWqMJjPggix+x1/r+jbiQm/dkchqmUd0yEIxwp0Hlm5NhVU9ErKGehgzwpesLyor32Kztwn5IyP98aCwetO1CLCG2p8gyZYfFyyqq+WErNqRUPcZVBTYHFsREKLmg6bATl7+RaORX9t5P65c9hoe+NqknpshSmuk1Zb1wGz8sznin+qjcS6ShbS+5N32yBDHyjctKH6dDl3ZZDupRv1xe1QTCQwHTvyHTqKu4HAM2vigd8Ewrq8BRF9KHNesABcmsc1zjC3mkPC4SPJ2UghMGPx1LoVwBaJBi1NpOOvzlx1FW4T1Buz5nkWJkEy9Pa7lozoH7anIsAUHvfVH27YkffOeb6u0vd2WxrWiGwyYBcLlRFJ3ixIhTbBblugH6Ux40TEn44D5tljgPqnbEKmLD2ks/NMhLlOvdQk1kqqMRRUs1dcHUFehI= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Introduce cpu_dcache_is_aliasing() to fix DAX regression
|
expand
|
On 2024-02-08 16:55, Dan Williams wrote: [...] > > Oh... I see you cleanup what I was talking about later in the series. > > For my taste I don't like to see tech-debt added and then removed later > in the series. The whole series would appear to get smaller by removing > the alloc_dax() returning NULL case from the beginning, and then doing > the EOPNOTSUPP fixups. > > ...repeat this comment for patch 10, 11, 12. Done. Mathieu
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index f1d9f5c6dbac..e9898457a7bd 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -558,8 +558,8 @@ static int pmem_attach_disk(struct device *dev, disk->bb = &pmem->bb; dax_dev = alloc_dax(pmem, &pmem_dax_ops); - if (IS_ERR_OR_NULL(dax_dev)) { - rc = IS_ERR(dax_dev) ? PTR_ERR(dax_dev) : -EOPNOTSUPP; + if (IS_ERR(dax_dev)) { + rc = PTR_ERR(dax_dev); if (rc != -EOPNOTSUPP) goto out; } else {
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Alasdair Kergon <agk@redhat.com> Cc: Mike Snitzer <snitzer@kernel.org> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Russell King <linux@armlinux.org.uk> Cc: linux-arch@vger.kernel.org Cc: linux-cxl@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-xfs@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvdimm@lists.linux.dev --- drivers/nvdimm/pmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)