From patchwork Thu Feb 8 18:49:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550319 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 85A77C48260 for ; Thu, 8 Feb 2024 18:49:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 55ED66B0081; Thu, 8 Feb 2024 13:49:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 510786B0082; Thu, 8 Feb 2024 13:49:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D7526B0083; Thu, 8 Feb 2024 13:49:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 301796B0081 for ; Thu, 8 Feb 2024 13:49:26 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C6BE4C0CD1 for ; Thu, 8 Feb 2024 18:49:25 +0000 (UTC) X-FDA: 81769524690.27.F8CD76D Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf13.hostedemail.com (Postfix) with ESMTP id 3C96F20021 for ; Thu, 8 Feb 2024 18:49:24 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=p981bkJM; spf=pass (imf13.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707418164; a=rsa-sha256; cv=none; b=42csL06sPjr0a4N1aLxS1JpQjw7ijxpkGxIzpSfCr0CvcwHQHVzQnzjsofl6hIOUNORRrL ra4i9bH/E6JZuAnr+DtCWZhu21aNTCHOcstmGJr44GPgUeGWSUq8dt3/HpCZPoPTBqBkW1 9N5YKjJfisWNr6nT3ug5o9EScsnfpq4= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=p981bkJM; spf=pass (imf13.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707418164; 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=TzzyzryuMk/YFmmwdL7/ClcZNi7RCUPErKB9A3hzeXw=; b=Y2ShU6P6LjLHQibWyZ/w1xhkUqNy1EEyXCdoeUKjlbyqr3nrtRqgFZbvs6EEdDbKDje0zF Srkv/7B5sAxIiJl2sUfOp4C0QrhY7+bMhl7h9bSOLlAJilG1YrqKztMg42i8eSqdVDPd95 OROgCbibYHPQB2drd55yEjO+Qo5d/PM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418163; bh=C9trdHKUBo0wvYK5DBzsNfOU9QCkPyPGO5T7CJRyOKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p981bkJMDqSSou5rOlzOfJadbQ5Y29NotpQj8i1nf+2MvVgxD1FBmL+l4Xm7YmzdU pVOSVM/g3dAlLka98d2D7RwQsxmwG0ztt/y7tiwbLnCbBg1xIMfMZO94OwRGQcJSPb oCvXA7vGn5txoQucNNDP9tTcibZl6yUWk91V3wI4h34U+qdeKKwoaP4EMRaCV9XKgF S42nnYMRLuRYjp1ifApVRqANDFYDEM92NpD/EJeqN1d+yPvkJOrTEc6AotGzGZx2U+ 6+NLjtZJNGG8sAZom+Btw0vTtF6/O0vjyrrF0zmTTKf6S58kysA1oIjzBQgjHVR/w7 0MBHTWE0Z4ToQ== 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 4TW5cf5cnczXwf; Thu, 8 Feb 2024 13:49:22 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 01/12] nvdimm/pmem: Fix leak on dax_add_host() failure Date: Thu, 8 Feb 2024 13:49:02 -0500 Message-Id: <20240208184913.484340-2-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 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 3C96F20021 X-Stat-Signature: cso837hfzauu5p5dfjeqzmcwnf4gi3zr X-Rspam-User: X-HE-Tag: 1707418164-5568 X-HE-Meta: U2FsdGVkX18vg9yHBrjEWqcV3EX1RQB1fVEM40PIKlx4y92nQ8diRebdbaVCm5ga0gaNRLAc7u21KKDWwKnCDPwabkoY1DDnKyjLxWxihbfsR1z3Gy+3sgblPPmEcIx6dnsQqK0mB4wRpkOenqdds4JXzLk8cpAB7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6xjW9ylKP5TqpcZlzelBSITlFkFy5Vjc+W+mtcE8gZxkFCUE2l5nT35RiqE8VKDG1q5CIv0FFGDKA799gm97JOF7D2DOKJjXXR+9Ds2ZQLTcFrVYUuxxE+4j05ZZmDNPgJyl3PoFK3xEpxoBZIqtkI9WWcPwUJ3/cimUpFHPJYdTDky0qGxLmT+u4SwWVEpQn91j70bYzKlN1aEuEEwGlKYaKb8ulFLiw0YGLeUo1R4cOUbEgF6dWl+oW7HAV9n3XnPP7ymQsmcewMIo3Bhjz/pfAI+7fNDN98rPeEHS9fV+fxmE6zDIFUaOsIbsXXCvURaagTBlFMmelGm0yXANrDd0j1PGjvlshML08hRoPu7DRGTg3Hx/z8XVtetsu6UNbouoSGAwCv9qGCEW9LBKIdfbQNdemWlZCpurQ= 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: List-Subscribe: List-Unsubscribe: Fix a leak on dax_add_host() error, where "goto out_cleanup_dax" is done before setting pmem->dax_dev, which therefore issues the two following calls on NULL pointers: out_cleanup_dax: kill_dax(pmem->dax_dev); put_dax(pmem->dax_dev); Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 Reviewed-by: Dan Williams --- drivers/nvdimm/pmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 4e8fdcb3f1c8..9fe358090720 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -566,12 +566,11 @@ static int pmem_attach_disk(struct device *dev, set_dax_nomc(dax_dev); if (is_nvdimm_sync(nd_region)) set_dax_synchronous(dax_dev); + pmem->dax_dev = dax_dev; rc = dax_add_host(dax_dev, disk); if (rc) goto out_cleanup_dax; dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); - pmem->dax_dev = dax_dev; - rc = device_add_disk(dev, disk, pmem_attribute_groups); if (rc) goto out_remove_host; From patchwork Thu Feb 8 18:49:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550320 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 D8A7AC4829A for ; Thu, 8 Feb 2024 18:49:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1DFC6B0082; Thu, 8 Feb 2024 13:49:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 97D1E6B0085; Thu, 8 Feb 2024 13:49:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F6B46B0082; Thu, 8 Feb 2024 13:49:26 -0500 (EST) 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 5279C6B0083 for ; Thu, 8 Feb 2024 13:49:26 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 30242160296 for ; Thu, 8 Feb 2024 18:49:26 +0000 (UTC) X-FDA: 81769524732.27.BF9DAFC Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf28.hostedemail.com (Postfix) with ESMTP id 981AEC0011 for ; Thu, 8 Feb 2024 18:49:24 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=BHv82fq4; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf28.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=1707418164; 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=980dRtjhZ1sqASItbAJHswL4sSjsBCZ26JEnu08+RSE=; b=6uzdpSivArlIj8wa8a9G9cb0L2I6eJQJje2wTrUQsZEci7O7GTwzXzFWvwZ+bvhRp0U1+E NZSrnVx7IPAm4kPYBM5jhFPxI8Z3bRqoQJKfZOcqzAsREkmvOP4e+K4nXJSqeX+9ZlSV+4 mOs44XpUq67USY1jn+B3I8E6aXQ6UBo= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=BHv82fq4; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf28.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=1707418164; a=rsa-sha256; cv=none; b=PfUOZlm5/i01GqWNQvtyWtaNW/lAvz1OwZa+OPm9Ks8I3gUTTIu9dYmOFWqSftpSNm/3Rt 5McrKkBgcUu6CkA3slID/3v8EuYE0AE0zA8hY1oD+ybEqTVrvuWvz+WCbK2DkJpKO2qwQS uB0j7plDQDnZNjkiTxTFLkR27duv0rA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418163; bh=NdQ4OmFkV2+G2H8B4VkXTCxDeM+TIHeVIiPEQVlM7R8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BHv82fq4hO859vusQup+/Ew3E/xkDIrfZ5htPvlriwUnHkvNeARgnnZMiSWHzApqW mBUnp7NhYcFC4sHncmcbqwbZiLufbXuPZ1mmrcc2XRx2OacMg8w1iMcNtrBwOoQ7t8 tlegoMFq/Kcq54d6KDuhbA+a5CHjBM14TYr6oFPdFcRGkfXiGVluKpmPuYTt++FmPu urOv+1cJgX+X7s/GbAlJpQacEjTwJqNEmsDVAUYaXnkKjRNrV7bXs2jN1Ij2VQhEwb /6iWsYm8EPA5tPa8SlmPXLVR3oPElZBuasrhf6GDfTwyLf9CcfdtgsPjHjkxUKokLX dtG+zbC42rI5A== 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 4TW5cg1khXzY5L; Thu, 8 Feb 2024 13:49:23 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 02/12] nvdimm/pmem: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Thu, 8 Feb 2024 13:49:03 -0500 Message-Id: <20240208184913.484340-3-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 X-Rspamd-Queue-Id: 981AEC0011 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: eexhmbmahxpipp6uhk9pipnzbpkxe87j X-HE-Tag: 1707418164-966132 X-HE-Meta: U2FsdGVkX18qouNOJ7UuNgTAlGIEdQyvwCVZUSIT7xmOiid0epXTUPFX9AErFBaTZlvpxkThU1A9oBb+bLwV8wiLS2PwIzHh2lrMGkG6Ra01/hfNaeop1xMj0Cv/ZWs0JYGlu58sdGyqP6Td5UrsJI55v/Qiujv/PFeYnwuj45qvOg7h1Ao2cN5NWxGYYKdos+qRyrkTP4atkMmDyKC+q5V2PrnjykKWEtKBDp4d6CY3IPKCNTt37vxhSmfsBW5ozkq1MqR84r0130O20xM3U1bQ/kiw7QRDkZw3flNLaG3sCHyDLUrj7OMKZlq79jXIJ0R7VHtc9eNp6GsAD3UU4ZBjQDVUzZ1uaol+QCUAqjnznEqd5yllQS/Hu6nROpv+utLYKU1GRmuaFX9Mz3/HwP1OkROoTvhKUrMbnY3waNYyxhDbq3ThF+NICnbJGfctzkh80sMzCeLkUr4vSS++u0L5mop+yj0CY3xbuqOOWkQoScud50wgselsMb9yqam36tmLjVosSSTkZ85S0X3Rd7F59F6UbJufg6wfIl++S1ZpXO6yXcjUEZjgyqUj3ns0aWqLuWPg05imo/l5gksGh2NPrdsBcCwA+QwkdWGRJT8I0Ley5qywGmHlDzY/d5nu6KWZ2d1np+7b4cIR7Ou3o44Va9T/ukdviYdK8IuNqHQEAR16mu4L7yK64n5W+UFNXkzNHSZFBJtyG7QX6x340tDta6lTvozI0+XhCpnmmIiWmmxOygOs/CwxVLgDJbk4LTg4mln0vDQqGAVADvSGvTTg91TM1tRpELWdSgsPJ9nKJOcTrAbP/FT7IzpkITwU08flFgjCfNv1ia3fhcK8GZqsldqXm5Z9ddn2iokxNDHbjkHuNs5cgjFSSa8zGymuy7+fkfIXNq0RkUOlpgrUqIA3MynOxV5lO3BIkHYDq+BuAgvbkY2ZjS1Jn3lzyHBpmcO7N+zWJkp/NtoL46L yR/Y2nuD IJ+0t5D8uWAdAanwNFhzknDUFz7cmweJno8jHmA30YS6BOwWhVThY+wfQ7N34v2Oqh4QqbSpP7a/4ZtkUvYRsRyGOywD82PlaXQpbny/xS4yj7EaHWhaWFjbDOYLaf+POyvFhw5H/bd9+vIvfcogNI/ra/4eLsDjDC5kMkO7sTOWyq75JmbAb+h+Oji8HSHGxWRfrzuKfJ/xN4+nmSmwCa4QeblLxn4mc1DfdryvYWcfjvnn4s1Ien8iL1quL44GVf2GbHMIUrtrch7s70WHj8wn5Rru5I/Q96HjMTRjTXDEjMZqllBU6N3DupdEqPUxXIp1N5Z+d3j8hvm1Du+Ncq8yFldAgvwoa/KHZsE+kDSrhThMJpRHXvps3mAwhGYYR7M/kwezZr9n+N/aN0e2ulojZ2EFjqyjThhHUCASatH4Thty32T149lGCG2bEOSJlG1P0ipHwx4dsh7zwctU9/T2q1c1n0TQLhcCSLMMStDvfRsZqRfzJrNyvGDwN0MbdfJfwzr7DZepFca/Bdrl27X1APkJ14I9wdnJud+vW14fVuWjwMVUj0PE7u8DFQDDq8w0H9FxDcpZEeB+yJjLIvnMKNuggkae2Efb5F8h8lBiKlBskG+GK89OH+xoFeXhohIqpHmhSk+yjwXU= 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: List-Subscribe: List-Unsubscribe: In preparation for checking whether the architecture has data cache aliasing within alloc_dax(), modify the error handling of nvdimm/pmem pmem_attach_disk() to treat alloc_dax() -EOPNOTSUPP failure as non-fatal. For the transition, consider that alloc_dax() returning NULL is the same as returning -EOPNOTSUPP. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 9fe358090720..f1d9f5c6dbac 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -558,19 +558,21 @@ static int pmem_attach_disk(struct device *dev, disk->bb = &pmem->bb; dax_dev = alloc_dax(pmem, &pmem_dax_ops); - if (IS_ERR(dax_dev)) { - rc = PTR_ERR(dax_dev); - goto out; + if (IS_ERR_OR_NULL(dax_dev)) { + rc = IS_ERR(dax_dev) ? PTR_ERR(dax_dev) : -EOPNOTSUPP; + if (rc != -EOPNOTSUPP) + goto out; + } else { + set_dax_nocache(dax_dev); + set_dax_nomc(dax_dev); + if (is_nvdimm_sync(nd_region)) + set_dax_synchronous(dax_dev); + pmem->dax_dev = dax_dev; + rc = dax_add_host(dax_dev, disk); + if (rc) + goto out_cleanup_dax; + dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); } - set_dax_nocache(dax_dev); - set_dax_nomc(dax_dev); - if (is_nvdimm_sync(nd_region)) - set_dax_synchronous(dax_dev); - pmem->dax_dev = dax_dev; - rc = dax_add_host(dax_dev, disk); - if (rc) - goto out_cleanup_dax; - dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); rc = device_add_disk(dev, disk, pmem_attribute_groups); if (rc) goto out_remove_host; From patchwork Thu Feb 8 18:49:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550321 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 34A1CC4828F for ; Thu, 8 Feb 2024 18:49:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E38EA6B0083; Thu, 8 Feb 2024 13:49:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D9B5A6B0085; Thu, 8 Feb 2024 13:49:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B754C6B0088; Thu, 8 Feb 2024 13:49:26 -0500 (EST) 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 A38AA6B0083 for ; Thu, 8 Feb 2024 13:49:26 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8224580F39 for ; Thu, 8 Feb 2024 18:49:26 +0000 (UTC) X-FDA: 81769524732.20.DEE81A3 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf22.hostedemail.com (Postfix) with ESMTP id C7E87C0019 for ; Thu, 8 Feb 2024 18:49:24 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=UblpDhvf; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf22.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=1707418164; 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=xK83i6t7USeocITc70y4DYr6De00Kwc5YNFwgYpfZGM=; b=7kkHiRF5w+zz+DIeIZQ79sKBDsDnOvnlVyCa8aYzoEvOgT1AcYkWWVzJUD7MjKmkGL3H+2 r7fkH1coIWvfZoFxSdPNzs9ZhyHmxQLj+qBEx36F78c9ir+p0BKRcSlta3MPSjeVc+FSBr EHRmuY1yblKkZNFCktwz9pRF8L5XOh8= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=UblpDhvf; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf22.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=1707418164; a=rsa-sha256; cv=none; b=p1PXQC5U0lOXsPXQ8/idhqPgxNJ3/CeJVzIjxDjoTGR/bL9ES1bJ/PsVtl6EJWDDgwpS5V EaPfhs+vZQBF0uDZFvVAsLdZ/CGK5BjLpNZ5Nd8HpLiIFdfdJKJoHJWQ5XxFqvLz/pT1T3 MJ5YNhirWEjY05z71uQsrapKx8nAXWg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418164; bh=Cw819/KonN7FOZNMfLR1Ivonx2xW8T4iDPwkWkOj91U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UblpDhvfHANKqJFQHeaHwkIpXUAIYpC9oPLq0TvfWfeRXeTXyN+gn3/3ZipKcpRL4 eL3OcfWoFDAmV1IC2qHFKtps99Jv9WaIB34f3niYgPevHxifDv2iVq2oe1H8HJ7VY+ OXS0FYiaAgd+LT/r4tnoX+2TAAL0JEi+bOVAMyUtknBxHB/5sMW6AKhnI7xTUrvyRe 1esVYyBFR2R+W7fxyIfhFzUjx358IVx4OTM22EMYEIi6AWNv92bRBLshKWZ2Uhecrn LmOjnmnM7mNgo8jd3iGTu7S7JpDScrW0M2MFW/F0ToU0paCORuAOPQK8zLKt+kMQa0 nRRCOKzwzHRQw== 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 4TW5cg4y4VzY5M; Thu, 8 Feb 2024 13:49:23 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 03/12] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Thu, 8 Feb 2024 13:49:04 -0500 Message-Id: <20240208184913.484340-4-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 X-Rspamd-Queue-Id: C7E87C0019 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: makthzccafjd58k69x8q6d7j9fhw99zx X-HE-Tag: 1707418164-401375 X-HE-Meta: U2FsdGVkX19o963ZEUIix8WFRcvtsGtLW+FDpsAgGKiCu6NriAVOr9wfHlRNz0pVFOxL7bvv/VdBCcuS89rMFOKTHCatt8COgQNk/moX7P4CloruipA6SNB9IwRT9xcuVlPJbFoePLAqocG0E7Mh01lY5/5B7n8ZXzMZdn1Ddpg/wnCqfEUCSXgwTLUxSKIRD97Y2rwhkNjDiy2mQ/EUeA4+qxwqdQC57T4pp1Opx+o9y9pckOjWgC1za1Rabu0CIn3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g/t3wO/i3EBwkgSne30c2CNJ7O4QaM4uww4oj0DAiLEDB8z8DPiobHDa5KFqIjS/vdgmSPUdOISUDlWlZJ25CqNdL7U96oG64PDjiS12dGX7f/S8nDaiv46ieIBjQVoXYR/mkZVVEVyufWUC7iYXUTumbkP76WRyHhYmrD1RyvdSDTLWM0/Bu/VNcWFBxcSVp1MRvRVmIsLGrsJwUSKjk0tJqW/j8eJtWerRcmopDqgJq/F6LmMeXqo9v80vPs4hpvrtpvjC7kU9wuWizqtN8AUJzTDIWdv4HwBtZNFDcjLTdNz8ZnSSwXFiGy9gxgdWgCtOT7lGt93a 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: List-Subscribe: List-Unsubscribe: In preparation for checking whether the architecture has data cache aliasing within alloc_dax(), modify the error handling of dm alloc_dev() to treat alloc_dax() -EOPNOTSUPP failure as non-fatal. For the transition, consider that alloc_dax() returning NULL is the same as returning -EOPNOTSUPP. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Suggested-by: Dan Williams Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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/md/dm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 23c32cd1f1d8..2fc22cae9089 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2054,6 +2054,7 @@ static void cleanup_mapped_device(struct mapped_device *md) static struct mapped_device *alloc_dev(int minor) { int r, numa_node_id = dm_get_numa_node(); + struct dax_device *dax_dev; struct mapped_device *md; void *old_md; @@ -2122,15 +2123,15 @@ static struct mapped_device *alloc_dev(int minor) md->disk->private_data = md; sprintf(md->disk->disk_name, "dm-%d", minor); - if (IS_ENABLED(CONFIG_FS_DAX)) { - md->dax_dev = alloc_dax(md, &dm_dax_ops); - if (IS_ERR(md->dax_dev)) { - md->dax_dev = NULL; + dax_dev = alloc_dax(md, &dm_dax_ops); + if (IS_ERR_OR_NULL(dax_dev)) { + if (IS_ERR(dax_dev) && PTR_ERR(dax_dev) != -EOPNOTSUPP) goto bad; - } - set_dax_nocache(md->dax_dev); - set_dax_nomc(md->dax_dev); - if (dax_add_host(md->dax_dev, md->disk)) + } else { + set_dax_nocache(dax_dev); + set_dax_nomc(dax_dev); + md->dax_dev = dax_dev; + if (dax_add_host(dax_dev, md->disk)) goto bad; } From patchwork Thu Feb 8 18:49:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550322 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 9C1A6C4828F for ; Thu, 8 Feb 2024 18:49:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 38A9A6B0085; Thu, 8 Feb 2024 13:49:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2EC4C6B0087; Thu, 8 Feb 2024 13:49:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02CF76B0089; Thu, 8 Feb 2024 13:49:26 -0500 (EST) 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 E5A4F6B0087 for ; Thu, 8 Feb 2024 13:49:26 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BCD6C407D3 for ; Thu, 8 Feb 2024 18:49:26 +0000 (UTC) X-FDA: 81769524732.21.AD420D4 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf01.hostedemail.com (Postfix) with ESMTP id 2F21940011 for ; Thu, 8 Feb 2024 18:49:24 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=rGs7b1kF; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf01.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=1707418165; 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=qoFC8C6ZSnf/nETi8dojk/VMfXsfmFrumNn7+RHaPbE=; b=ku/7gMP6nr+dUGQVKFbLqeckg3PVT2RXeeIAueI4PbX2ihbLP6KMxs3Ct4mpdBzRa7py2D qtxR6HaN04zexaUeSiT+wJ1NArIujAWEldcvi/exhmZU8X9pjCoAuSQ7GLPgLvLIk8KiJG uYzoNALowJ4+/uS76cNXZqPbX0Ck8RI= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=rGs7b1kF; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf01.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=1707418165; a=rsa-sha256; cv=none; b=b01llTomyXAUa3k4aUnwV/7g2iPGOS2DDZE7UeM4hMkG3r6r/iNyDpTuqwsarir/OQMF9+ HbfxtMLp9RjEAHqFSsgWmIJxkaC9kN6irKYYqIJSa8cn5HZTZUHWVGx0EHRq4Hp/idpoBP fwZJpgqeP0zCMYhi+TGgvIU2ptc9FlI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418164; bh=NIplNKYnPiSxsRcYozD6/Em7BpOZVdeSTtUJ6fu0NbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rGs7b1kFhgfAs3N/uvEWI1LxOdWWwOf5Idgjm+vAqNckZQpPBHfp3mnqwBxXijrHv 5KiC01SlkwbHwbvsekSqj9SSiIfc95BaqD1nYMoY7nP0Mk3CxY2cdTsE6XvAKevwPP vnyZOaqMa+GfTPHHNezRYLo+7hkjmHDL8EOr/Q6EPiSPZ5iRUshHstOAdlIBni2RMp XgXFTCjlqGhkB6UpGo5vnJh10r7UGM3RRHCVc84K8RQBgvZ89az4CSg9N71n0g7y8o mYRgyniqWFk6i7vnViayymIyI1PE+SlxBZ1BUkhtw3NPOY38OlCnjyRF2bYF4Asfiy Y7nc3TPTaQzkA== 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 4TW5ch0pC3zY9Z; Thu, 8 Feb 2024 13:49:24 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 04/12] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure Date: Thu, 8 Feb 2024 13:49:05 -0500 Message-Id: <20240208184913.484340-5-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 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 2F21940011 X-Stat-Signature: yaxhqgoj74ypztzhn1k39ubkah9pdg46 X-Rspam-User: X-HE-Tag: 1707418164-518666 X-HE-Meta: U2FsdGVkX1/7vocUevyJlQtSABtg0/BYMk3mRAm+xV0G2rWglDNlcoAtSkdiiR9/8pqrHqVAjT1rJgQxWp3fD3TyAlgShIhx8sk3gUbm5DIeZRZ8eQH/fjxBlWze8WSPQS8/4MHa65nZRqOcwoeiAtri6TvXI92e4BG/glwothSCF/qSzzX+Y+gEqDbTH8FliqT3xPmYpioMi1HoMaw7V0HLt8khy1T1rom5F80EgxoU6MAHTXEZr0GKmOMTMRxa3fkGALFO2XrwOQOIn7P36IIhTIR9FGUWcO8TcQ2QkSgdTNXTLy2ZQj9DnE7AqvRjg8ZVdxDpTp6xe1A5USGL2RtksAwJfPXA2l8UJmGhdVtwivADYk3fTdm/4f5+xcc7W1f3GIo/I/idP1RPfAg6pFmu5lgcl0TDRjHq/zYQNefNvyEQZvKY8xVz99NGUMw1Fyi91YtvcFBJUK88/KM4+EJGid29/k4dYcF0rIlrprLsGQNl+2bUfImRNZKJnFX0KHinPHtPi5tLONEzRdEJoCAlPPqqNoJyxz4FhEoO9LpFbYn60Cc/NYegmnSEcWrO2zXyOO+MNcVSTiS8Jx7deJu5rpVdVKeVPamHz/VnQcFjxBjhej4w4Q7pBt3eBh51UN94TxDccxBup6q6xHzM6v432UGcWCQP8IhIeXXOidrdMv56HkuAN6RykPwgBpp+/D5LgUS4hyhIMoDL571Uu3cGRYT9GKiqgDitR0xImFd66JLPwhagIA/Trz5kV3mhU07LpVrYNQ3PRR4w8UVnnx96TcV3+CZLttWEvZ2RMNa2O7qOJJp46+EEu1Sk2IF42+wPd7o6ooydrWvN1QYBF2BKR49LHK0CUq1hrzcOEH6ehL5W78YeduInOz8fCh61PDJEtowKilJ39iyPcTWMw0SwmaWjvxIxucuCoY9b4TZfWJUnSjZAHf2NW2DOeak6xN5tt6mdCHUIqCVhmOC yanpSigg jVx01pjXbR5qP45kSxP0es+i17LKtftPxQyejOmLpp8BsZIAMFfU7x/Sjf+I6Wxp4EVZOuFL+2gooAgP1GW+VNujeHho/G51cOnxb3tH9oxJrrBsYNBnk3dBvxM0+J8BTyzazS8KwA6p2b056DZUfGA0mh3rd17HNbOUG8flEmniKEwqnrIXepwL1Kut8xl3Osmve5wZt/Fi6vP9fukKx9+fRALS9MoWTc1fRYWVfFl1E/JV8AbCOxViYPKiND9zQz16LFiubdtKIh14jSPIUpiE9NcTyO6EvS7KDZtq6cS5lEeHvX67Safq1QJ7p6urSV/rS4Sgv/W89fsqRkUz5SyKE3d4pR/4Rxo8EpWvjSJ61laWkEJAqAYQheSjQNi5o7T2vCJyCHdzQvt9Z+TJQHOIRE2m9uiZuSG3i3WUJYcMaUtrKIIrKnBFMA1Mk6KNIJacnp0eZQcCOv6KXIJjfGOQVemj45pBpdFz/kWbTQT8UTcpvaz9kVWued5wIqIoNc2jP+NYb+jmQLb4fFNMEd53dgx4B/GccjP/ZbaKhRioGaH3EEtZyPBrkx106z1DNbAPXS3bpMyFEWEvtKoa2gu77cti07EhaXuSUGPhYVVCyN4FjX4oduGLChs5D5J+mIevUsNf2/yVyoxI= 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: List-Subscribe: List-Unsubscribe: In preparation for checking whether the architecture has data cache aliasing within alloc_dax(), modify the error handling of dcssblk dcssblk_add_store() to handle alloc_dax() -EOPNOTSUPP failures. Considering that s390 is not a data cache aliasing architecture, and considering that DCSSBLK selects DAX, a return value of -EOPNOTSUPP from alloc_dax() should make dcssblk_add_store() fail. For the transition, consider that alloc_dax() returning NULL is the same as returning -EOPNOTSUPP. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 Cc: linux-s390@vger.kernel.org --- drivers/s390/block/dcssblk.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 4b7ecd4fd431..a3010849bfed 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -549,6 +549,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char int rc, i, j, num_of_segments; struct dcssblk_dev_info *dev_info; struct segment_info *seg_info, *temp; + struct dax_device *dax_dev; char *local_buf; unsigned long seg_byte_size; @@ -677,13 +678,13 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char if (rc) goto put_dev; - dev_info->dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops); - if (IS_ERR(dev_info->dax_dev)) { - rc = PTR_ERR(dev_info->dax_dev); - dev_info->dax_dev = NULL; + dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops); + if (IS_ERR_OR_NULL(dax_dev)) { + rc = IS_ERR(dax_dev) ? PTR_ERR(dax_dev) : -EOPNOTSUPP; goto put_dev; } - set_dax_synchronous(dev_info->dax_dev); + set_dax_synchronous(dax_dev); + dev_info->dax_dev = dax_dev; rc = dax_add_host(dev_info->dax_dev, dev_info->gd); if (rc) goto out_dax; From patchwork Thu Feb 8 18:49:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550324 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 CF0ADC4828F for ; Thu, 8 Feb 2024 18:49:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B2DF6B0087; Thu, 8 Feb 2024 13:49:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C5BB6B008A; Thu, 8 Feb 2024 13:49:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 145EA6B0092; Thu, 8 Feb 2024 13:49:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id DEC7A6B0087 for ; Thu, 8 Feb 2024 13:49:27 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B4539A265D for ; Thu, 8 Feb 2024 18:49:27 +0000 (UTC) X-FDA: 81769524774.14.0AA6E97 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf30.hostedemail.com (Postfix) with ESMTP id 0BD4D8000F for ; Thu, 8 Feb 2024 18:49:25 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=G1otBWj1; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf30.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=1707418166; 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=p09K36qcF8CV8GY17NNSA6slg2+YUMG1wkffTYeeubM=; b=57brrdCjtIxqhehKDtwFIUZqsEAOLXZ4OTMX9W+MicvzdmmpGa36H6Ohm1HX3adRxbU3J8 kaq9wuxc1LcgCeZVfokTJcI5gIIeFeMk99Y/o9F1k2khfPZhW9RrYqPS9Ja2iAHLQ4nOOI 8LeoMU1QMHJ0fqEmw9N6bOjcN4TsTU8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=G1otBWj1; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf30.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=1707418166; a=rsa-sha256; cv=none; b=c1WTHn7nq6tkey6ocUGr84OMftwrxqG4btfJ95dj10EodauAxTTIZaDydURRsbylOPXAZX 3vsuOqFWNXG6Cz8ym2A3Gtg3/1sU7SsFZIAPVHFSr0D5jekQfmRb80uFAAzXCM6t1WWxPO WZTVbSVNhdCFD+bPmYYxtcdaMDkoRZI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418164; bh=6kaHeiBxh7tXa+wyC1kCcD7MhkDErN5w3UH4NjBdGts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G1otBWj15OtcJQ7enAUe6jy4+Hmw1j+1RwF/HjVZzbrmTo0Xq8YXGs0hrk2qusl1d eijVgRfCPmEmMkGdLStUirsrDOsQmxW/Vfu7q9zBCAFzVJhw85FoIlYd4T1LBmOIGy AJ7zW/g2Rt4d1ND4RQ50x/gK+b6zeCeinDap1WQDbFiItLb5CYncWggvKtcuuQp4fM LLzxPROqJhaQezmxcMN5SI6J2fdnGw88vf+f/UxShR7g5ODOvE8FjXmQHReKIcaIMH 8L15rahH+uIOjMvUoX/ApTNmMuln8Ju+P7uQzH2v/mh1UushfEwCFZqtPgbFAqH9ST vz4YFgZmmOK/A== 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 4TW5ch438gzY5N; Thu, 8 Feb 2024 13:49:24 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 05/12] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Thu, 8 Feb 2024 13:49:06 -0500 Message-Id: <20240208184913.484340-6-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 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 0BD4D8000F X-Stat-Signature: guzso1yuurbpw3p57ob69w39georjmp8 X-HE-Tag: 1707418165-431575 X-HE-Meta: U2FsdGVkX1+wnpMSq89sXwWENA/Fb592MBkjQpreP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lMnwtWnyLNpFgN+3GHNqOE2900ZyZz91MSkxoo1Rx29W4yHvfMJlNehN3d7YWcEPW+X1DlSYjvdD7xda10RVQZkSmobJdRvxQmXSl7WqT8F9CK91X1Dv541YYfk7KwWQgwvBtgxL+Bx8I2jk7ccR9GAFjhorh9z5tB6q/sPen2mBIJlZG1T0OOTT7YQoPB72Rr8M5WlIfJLLazTTp7We6NIIeMZD0NKSUMK00ckDE5A5qJepSth1ryI/G51nJJVQZdqnkUZzl7qzYwasEc2QFOKSc+ESXjRrF+VAXKOV/eM4eH/pwNi5vYs4C62p6pqBxrwh1zlIiZZzsXqC+lrQT11FUy2LUCF6t2DnNeFvsKf4g2UI3w+fSGJwE96NYtoMt0GONZ/3WaDsUgOs860ObuesQ1tqr6JTnEnWc0ffzTuJpWcCv9aw0Ae+xohlmmsGkh87rmz8GR4GkianY+Kd9F9oNWzqXfBgeHf3yC6klPpUM3U8amdJOU5Z3qWZchlIeVk251h8XtLTjzKuHE= 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: List-Subscribe: List-Unsubscribe: In preparation for checking whether the architecture has data cache aliasing within alloc_dax(), modify the error handling of virtio virtio_fs_setup_dax() to treat alloc_dax() -EOPNOTSUPP failure as non-fatal. For the transition, consider that alloc_dax() returning NULL is the same as returning -EOPNOTSUPP. Co-developed-by: Dan Williams Signed-off-by: Dan Williams Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 --- fs/fuse/virtio_fs.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 5f1be1da92ce..621b1bca2d55 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "fuse_i.h" @@ -795,8 +796,11 @@ static void virtio_fs_cleanup_dax(void *data) put_dax(dax_dev); } +DEFINE_FREE(cleanup_dax, struct dax_dev *, if (!IS_ERR_OR_NULL(_T)) virtio_fs_cleanup_dax(_T)) + static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs) { + struct dax_device *dax_dev __free(cleanup_dax) = NULL; struct virtio_shm_region cache_reg; struct dev_pagemap *pgmap; bool have_cache; @@ -804,6 +808,12 @@ static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs) if (!IS_ENABLED(CONFIG_FUSE_DAX)) return 0; + dax_dev = alloc_dax(fs, &virtio_fs_dax_ops); + if (IS_ERR_OR_NULL(dax_dev)) { + int rc = IS_ERR(dax_dev) ? PTR_ERR(dax_dev) : -EOPNOTSUPP; + return rc == -EOPNOTSUPP ? 0 : rc; + } + /* Get cache region */ have_cache = virtio_get_shm_region(vdev, &cache_reg, (u8)VIRTIO_FS_SHMCAP_ID_CACHE); @@ -849,10 +859,7 @@ static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs) dev_dbg(&vdev->dev, "%s: window kaddr 0x%px phys_addr 0x%llx len 0x%llx\n", __func__, fs->window_kaddr, cache_reg.addr, cache_reg.len); - fs->dax_dev = alloc_dax(fs, &virtio_fs_dax_ops); - if (IS_ERR(fs->dax_dev)) - return PTR_ERR(fs->dax_dev); - + fs->dax_dev = no_free_ptr(dax_dev); return devm_add_action_or_reset(&vdev->dev, virtio_fs_cleanup_dax, fs->dax_dev); } From patchwork Thu Feb 8 18:49:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550323 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 2A9C5C4828F for ; Thu, 8 Feb 2024 18:49:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED6466B0088; Thu, 8 Feb 2024 13:49:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E8B646B008C; Thu, 8 Feb 2024 13:49:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD73E6B008A; Thu, 8 Feb 2024 13:49:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B9D676B0087 for ; Thu, 8 Feb 2024 13:49:27 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8C96EA0EA7 for ; Thu, 8 Feb 2024 18:49:27 +0000 (UTC) X-FDA: 81769524774.16.B09F758 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf19.hostedemail.com (Postfix) with ESMTP id 0260B1A0005 for ; Thu, 8 Feb 2024 18:49:25 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=rs1nJ6zN; spf=pass (imf19.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707418166; 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=Kwly0G1hIyigNj4R8I+M8crQH2nJcdxecRBcCdsJ/MQ=; b=kvX3xyZj+xlCJ/HqwyRIRxytoDx1leWWbiG0n4xalrQp5EQzex6KFh85vW8kzScMxiRGkB KxsjsdZ8a9RMbdVi8cOxE89+CIrfmH/BYzVhZ1KfS0/m+Xws1W23u833krjV55BHj4EL0F MtKm1jf8KRefmEGzNwIWK1XwBd6/jFw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707418166; a=rsa-sha256; cv=none; b=GOM5ZDGTGVsa+Mjy/22zC9FQUyRVMRjS3Y6Q9wUx/xl9jovINuvotx6q5wRbOpYztaF4wI c0Y0prgI1AWlVWlps9XRG5Wkwlqr5308VcS5Ax5L313NDI9h7IWErcBqn9JheiP8MdBL6e VPpgiXnMyVYZzJAMgA82vQBqbJAybxo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=rs1nJ6zN; spf=pass (imf19.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418165; bh=hDhYMA3F+4l5mMIlcEOrH62nfylV2E9jEwkIfVNtigI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rs1nJ6zN3i3/ZnxcqWVfIObvfKgetmRzKD9Xtjm7nBjU1gQXyq40Hbl0vGdpuDu3o 1ChqvqCpB68GsWf1rfPiXH2WI1izSe5AxZNgR4KA6MzUetBSQbo/tVCeXzBSfElY9X xc3j36GRCDUwpBwdU5OlD7I27mG/61ybZ+kJ7jSB1oIBSVNjk4niWIo1iYGy65l9dC Lvj2QNC53f0foG786M7CcQfXzWJiDcvHhZXtuINhQEsbaXYHm9nS5GhJjOkOW+XhzB TjMlasE8RpSnU8253RGAaFCEwDFmIZdtCUrzC2IzCiPp0guGxx7e15ixCGWwaFEOO9 2aK4Mi+ky1GfA== 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 4TW5cj03Z3zY5P; Thu, 8 Feb 2024 13:49:24 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 Subject: [PATCH v4 06/12] dax: Check for data cache aliasing at runtime Date: Thu, 8 Feb 2024 13:49:07 -0500 Message-Id: <20240208184913.484340-7-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 X-Rspamd-Queue-Id: 0260B1A0005 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: cuokkyqfrzunzh6z3wgkci6gww8b9ez8 X-HE-Tag: 1707418165-962445 X-HE-Meta: U2FsdGVkX1/OkkOEnyCh0I6foRvRsKsLM7EA4W83duaZYyZEYM2Mf53WlXCQR8gRK83NYW5D80Lh3JAiTl4Meb3mhfKalY9OxJbcjtAb4Ni5f6ikYkIUHQYj34WDYoZ7gr4C4l/0UygdZ+SD5WIC+Y7+aQw1uZ1biZ1MTL4Eb6GIyeJujGi0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QeeMUjL6dtZu0lmimMiMjuckDMYfWTE0+eE/VP6tOCVilF1p16h/NqxQBmX7dIkIN1y5/XBrWO1yDTEL62/hGPz3mKuRcQab3vWipULWNHAZf7+yS1LKt2oi9i6eXUVFVbEHRKSWTUGrWnKkLM13GUFItmPsa7t8SWOO0LQg9MylkBuEYHpKTMB1rnypkKG+YbRkdpT64MpoeDSd/cZM1ovrIGWqsXw+nGje4muBu8RW0ejQQstkf70rE3LkIfa+CZooLEqy2GPqblmk7Stu7FeO0zD6Y04bYNZ2QoKGaETYvU82L3i7+J4c1P4S/qyfgqmg8RzCVbMWSXRN0 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: List-Subscribe: List-Unsubscribe: Replace the following fs/Kconfig:FS_DAX dependency: depends on !(ARM || MIPS || SPARC) By a runtime check within alloc_dax(). This runtime check returns ERR_PTR(-EOPNOTSUPP) if the @ops parameter is non-NULL (which means the kernel is using an aliased mapping) on an architecture which has data cache aliasing. Change the return value from NULL to PTR_ERR(-EOPNOTSUPP) for CONFIG_DAX=n for consistency. This is done in preparation for using cpu_dcache_is_aliasing() in a following change which will properly support architectures which detect data cache aliasing at runtime. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 Reviewed-by: Dan Williams --- drivers/dax/super.c | 15 +++++++++++++++ fs/Kconfig | 1 - include/linux/dax.h | 6 +----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 0da9232ea175..ce5bffa86bba 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -319,6 +319,11 @@ EXPORT_SYMBOL_GPL(dax_alive); * that any fault handlers or operations that might have seen * dax_alive(), have completed. Any operations that start after * synchronize_srcu() has run will abort upon seeing !dax_alive(). + * + * Note, because alloc_dax() returns an ERR_PTR() on error, callers + * typically store its result into a local variable in order to check + * the result. Therefore, care must be taken to populate the struct + * device dax_dev field make sure the dax_dev is not leaked. */ void kill_dax(struct dax_device *dax_dev) { @@ -445,6 +450,16 @@ struct dax_device *alloc_dax(void *private, const struct dax_operations *ops) dev_t devt; int minor; + /* + * Unavailable on architectures with virtually aliased data caches, + * except for device-dax (NULL operations pointer), which does + * not use aliased mappings from the kernel. + */ + if (ops && (IS_ENABLED(CONFIG_ARM) || + IS_ENABLED(CONFIG_MIPS) || + IS_ENABLED(CONFIG_SPARC))) + return ERR_PTR(-EOPNOTSUPP); + if (WARN_ON_ONCE(ops && !ops->zero_page_range)) return ERR_PTR(-EINVAL); diff --git a/fs/Kconfig b/fs/Kconfig index 42837617a55b..e5efdb3b276b 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -56,7 +56,6 @@ endif # BLOCK config FS_DAX bool "File system based Direct Access (DAX) support" depends on MMU - depends on !(ARM || MIPS || SPARC) depends on ZONE_DEVICE || FS_DAX_LIMITED select FS_IOMAP select DAX diff --git a/include/linux/dax.h b/include/linux/dax.h index b463502b16e1..df2d52b8a245 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -86,11 +86,7 @@ static inline void *dax_holder(struct dax_device *dax_dev) static inline struct dax_device *alloc_dax(void *private, const struct dax_operations *ops) { - /* - * Callers should check IS_ENABLED(CONFIG_DAX) to know if this - * NULL is an error or expected. - */ - return NULL; + return ERR_PTR(-EOPNOTSUPP); } static inline void put_dax(struct dax_device *dax_dev) { From patchwork Thu Feb 8 18:49:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550325 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 8B6F8C48260 for ; Thu, 8 Feb 2024 18:49:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB9FC6B008A; Thu, 8 Feb 2024 13:49:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CC8B6B0093; Thu, 8 Feb 2024 13:49:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 759456B0092; Thu, 8 Feb 2024 13:49:28 -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 6065E6B008A for ; Thu, 8 Feb 2024 13:49:28 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2321A120F72 for ; Thu, 8 Feb 2024 18:49:28 +0000 (UTC) X-FDA: 81769524816.07.A7C20A7 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf03.hostedemail.com (Postfix) with ESMTP id 8A3B620018 for ; Thu, 8 Feb 2024 18:49:26 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="jkdm/qR9"; spf=pass (imf03.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707418166; 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=b3aliyJPOObhqkmOR4T6hnfMq2lmmTNJLVfgfu2Sl68=; b=cZogCZ6LE/NwXXyQsatKxYKvFVuyW/dUJpTCblJ6EGCcPjGe6BsjLpQPx8+IKVM7OzldUH wH9DreiCKdXdVM2ZUY9rMRI4S3PfvndUWXTHpKy8BtMUF9eIcinbZXpT+w0dQxOyKJGggk huE5BojGBMKtuiqLOJHnPipl0tu2EmE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707418166; a=rsa-sha256; cv=none; b=lYa8RYqVWoxYU2BT0PEye/ItaQzPiJ5hHACr2YVbVCV0I+wsxvqASEERgWlzhuR6jmzla5 pu+xZPsw5F5jBsEUX8wBs4BHrEI3QgHWsb94dAUIT52aVyfOWbJffQVZSFZnKi9N1j9Q/T RSZay4vuL1XGgR7Kd3/fId1d58WbIus= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="jkdm/qR9"; spf=pass (imf03.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418165; bh=yhcYPD4d/Sk8n4rn3QR3NdUtoL+Ae4/2ZbOPQLO15Yg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jkdm/qR9tPdloQMWsKy+5Z1d0aYHQtoBROVG4bGJmEkyZwYf6dkYO0DcGytMHFuip pMvcaT7M+g6JrZiEyz8lHuNZahF+nsZBUiNCmSvL0uhIqgO1QA0xibp+L8m+eAWiil UjmGp3s/WGGRlMHXDGSHyIDGaiB0e3LGeN9xdY159AmBp8P9lw8F1k2qbJt2Mjd96V rv8mHvj2INaIQKmuVhHbcxF1NMiir4TkGQlSDi49xLk+DNsiGNrcwkrefXwNsusmeW DIu2kttVxsDGoG0iiK4arY46DGoHW0ZGVNfKztcv/LyM5l/Wh7LncTwO4egX7FpruL 9PULzxXL9ej7w== 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 4TW5cj3Dp1zY5Q; Thu, 8 Feb 2024 13:49:25 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 Subject: [PATCH v4 07/12] Introduce cpu_dcache_is_aliasing() across all architectures Date: Thu, 8 Feb 2024 13:49:08 -0500 Message-Id: <20240208184913.484340-8-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 X-Rspamd-Queue-Id: 8A3B620018 X-Rspam-User: X-Stat-Signature: sm6nspcmehb7nqywr14n45kdkc65ygnf X-Rspamd-Server: rspam03 X-HE-Tag: 1707418166-974401 X-HE-Meta: U2FsdGVkX18p5MDxEY4qeNYp0YGeISV60zyshSufMcqOCvncxGTIx4pwV0Ko1zP3vtw6RZ2TO+dfERo8fKWyf9/9OZyg5Y0zC+3i0DhBOnBAIu/gXoZobDZPWzHFhpwmNNBjePo6+7pZnHPURqACukHmsCaznF23esuKiaYXd6gUOeONTPjqyuKTK/haOdmSjHEUjxlFkUrpGZyWvW7GpoHEkIjMcqaqJ3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cseqnECN4kJ9c3xUZ/504fzy5p7l0fWp32dIiBZI//Fu7kR+eXKzVjUnujKMot8g9ynfr7hRaPd3vdi1jFiq1UxoV/rZ/IGN93ZhNObMF+Q9Kvdv/v88aILV/1LK6w1V1i4HAm2pfxup1r6Qe6wWZjmR+VBJs0iPWu/ahUKZ/yYBGrK5CYfO6OHoWlrIjkckwI1KqO32Y0CuvDv2xselCNsGPNx+S/thWYEX+MGyADn/BCEJW0qcPAkIyj4sJX/tq82NxBdvaTDgFbWvVkcoJzVm2hC7xlfTrS9OsUAfOl8mWVc8hfUc9z20NNtUoZuZvvrd/z2AWE4HIk8BLUXQYtHhbntJSuEpRwgKSmd5v2P2d02VixfpO3EsxwIex0lhUFdNAu02IpKY6r11kn0i88oRlJKL0rygWiHAYjWMxajJga0Jtu/F8yuBykPfTLphINw7phXLH90ZJ1VWHlC5FznguRwJg== 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: List-Subscribe: List-Unsubscribe: Introduce a generic way to query whether the data cache is virtually aliased on all architectures. Its purpose is to ensure that subsystems which are incompatible with virtually aliased data caches (e.g. FS_DAX) can reliably query this. For data cache aliasing, there are three scenarios dependending on the architecture. Here is a breakdown based on my understanding: A) The data cache is always aliasing: * arc * csky * m68k (note: shared memory mappings are incoherent ? SHMLBA is missing there.) * sh * parisc B) The data cache aliasing is statically known or depends on querying CPU state at runtime: * arm (cache_is_vivt() || cache_is_vipt_aliasing()) * mips (cpu_has_dc_aliases) * nios2 (NIOS2_DCACHE_SIZE > PAGE_SIZE) * sparc32 (vac_cache_size > PAGE_SIZE) * sparc64 (L1DCACHE_SIZE > PAGE_SIZE) * xtensa (DCACHE_WAY_SIZE > PAGE_SIZE) C) The data cache is never aliasing: * alpha * arm64 (aarch64) * hexagon * loongarch (but with incoherent write buffers, which are disabled since commit d23b7795 ("LoongArch: Change SHMLBA from SZ_64K to PAGE_SIZE")) * microblaze * openrisc * powerpc * riscv * s390 * um * x86 Require architectures in A) and B) to select ARCH_HAS_CPU_CACHE_ALIASING and implement "cpu_dcache_is_aliasing()". Architectures in C) don't select ARCH_HAS_CPU_CACHE_ALIASING, and thus cpu_dcache_is_aliasing() simply evaluates to "false". Note that this leaves "cpu_icache_is_aliasing()" to be implemented as future work. This would be useful to gate features like XIP on architectures which have aliasing CPU dcache-icache but not CPU dcache-dcache. Use "cpu_dcache" and "cpu_cache" rather than just "dcache" and "cache" to clarify that we really mean "CPU data cache" and "CPU cache" to eliminate any possible confusion with VFS "dentry cache" and "page cache". Link: https://lore.kernel.org/lkml/20030910210416.GA24258@mail.jlokier.co.uk/ Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 --- arch/arc/Kconfig | 1 + arch/arc/include/asm/cachetype.h | 9 +++++++++ arch/arm/Kconfig | 1 + arch/arm/include/asm/cachetype.h | 2 ++ arch/csky/Kconfig | 1 + arch/csky/include/asm/cachetype.h | 9 +++++++++ arch/m68k/Kconfig | 1 + arch/m68k/include/asm/cachetype.h | 9 +++++++++ arch/mips/Kconfig | 1 + arch/mips/include/asm/cachetype.h | 9 +++++++++ arch/nios2/Kconfig | 1 + arch/nios2/include/asm/cachetype.h | 10 ++++++++++ arch/parisc/Kconfig | 1 + arch/parisc/include/asm/cachetype.h | 9 +++++++++ arch/sh/Kconfig | 1 + arch/sh/include/asm/cachetype.h | 9 +++++++++ arch/sparc/Kconfig | 1 + arch/sparc/include/asm/cachetype.h | 14 ++++++++++++++ arch/xtensa/Kconfig | 1 + arch/xtensa/include/asm/cachetype.h | 10 ++++++++++ include/linux/cacheinfo.h | 6 ++++++ mm/Kconfig | 6 ++++++ 22 files changed, 112 insertions(+) create mode 100644 arch/arc/include/asm/cachetype.h create mode 100644 arch/csky/include/asm/cachetype.h create mode 100644 arch/m68k/include/asm/cachetype.h create mode 100644 arch/mips/include/asm/cachetype.h create mode 100644 arch/nios2/include/asm/cachetype.h create mode 100644 arch/parisc/include/asm/cachetype.h create mode 100644 arch/sh/include/asm/cachetype.h create mode 100644 arch/sparc/include/asm/cachetype.h create mode 100644 arch/xtensa/include/asm/cachetype.h diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 1b0483c51cc1..7d294a3242a4 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -6,6 +6,7 @@ config ARC def_bool y select ARC_TIMERS + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_CACHE_LINE_SIZE select ARCH_HAS_DEBUG_VM_PGTABLE select ARCH_HAS_DMA_PREP_COHERENT diff --git a/arch/arc/include/asm/cachetype.h b/arch/arc/include/asm/cachetype.h new file mode 100644 index 000000000000..05fc7ed59712 --- /dev/null +++ b/arch/arc/include/asm/cachetype.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_ARC_CACHETYPE_H +#define __ASM_ARC_CACHETYPE_H + +#include + +#define cpu_dcache_is_aliasing() true + +#endif diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f8567e95f98b..cd13b1788973 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -5,6 +5,7 @@ config ARM select ARCH_32BIT_OFF_T select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE if HAVE_KRETPROBES && FRAME_POINTER && !ARM_UNWIND select ARCH_HAS_BINFMT_FLAT + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_CPU_FINALIZE_INIT if MMU select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VIRTUAL if MMU diff --git a/arch/arm/include/asm/cachetype.h b/arch/arm/include/asm/cachetype.h index e8c30430be33..b9dbe1d4c8fe 100644 --- a/arch/arm/include/asm/cachetype.h +++ b/arch/arm/include/asm/cachetype.h @@ -20,6 +20,8 @@ extern unsigned int cacheid; #define icache_is_vipt_aliasing() cacheid_is(CACHEID_VIPT_I_ALIASING) #define icache_is_pipt() cacheid_is(CACHEID_PIPT) +#define cpu_dcache_is_aliasing() (cache_is_vivt() || cache_is_vipt_aliasing()) + /* * __LINUX_ARM_ARCH__ is the minimum supported CPU architecture * Mask out support which will never be present on newer CPUs. diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig index cf2a6fd7dff8..8a91eccf76dc 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -2,6 +2,7 @@ config CSKY def_bool y select ARCH_32BIT_OFF_T + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_DMA_PREP_COHERENT select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_HAS_SYNC_DMA_FOR_CPU diff --git a/arch/csky/include/asm/cachetype.h b/arch/csky/include/asm/cachetype.h new file mode 100644 index 000000000000..98cbe3af662f --- /dev/null +++ b/arch/csky/include/asm/cachetype.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_CSKY_CACHETYPE_H +#define __ASM_CSKY_CACHETYPE_H + +#include + +#define cpu_dcache_is_aliasing() true + +#endif diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 4b3e93cac723..a9c3e3de0c6d 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -3,6 +3,7 @@ config M68K bool default y select ARCH_32BIT_OFF_T + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_BINFMT_FLAT select ARCH_HAS_CPU_FINALIZE_INIT if MMU select ARCH_HAS_CURRENT_STACK_POINTER diff --git a/arch/m68k/include/asm/cachetype.h b/arch/m68k/include/asm/cachetype.h new file mode 100644 index 000000000000..7fad5d9ab8fe --- /dev/null +++ b/arch/m68k/include/asm/cachetype.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_M68K_CACHETYPE_H +#define __ASM_M68K_CACHETYPE_H + +#include + +#define cpu_dcache_is_aliasing() true + +#endif diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 797ae590ebdb..ab1c8bd96666 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -4,6 +4,7 @@ config MIPS default y select ARCH_32BIT_OFF_T if !64BIT select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_CPU_FINALIZE_INIT select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000 select ARCH_HAS_DEBUG_VIRTUAL if !64BIT diff --git a/arch/mips/include/asm/cachetype.h b/arch/mips/include/asm/cachetype.h new file mode 100644 index 000000000000..9f4ba2fe1155 --- /dev/null +++ b/arch/mips/include/asm/cachetype.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_MIPS_CACHETYPE_H +#define __ASM_MIPS_CACHETYPE_H + +#include + +#define cpu_dcache_is_aliasing() cpu_has_dc_aliases + +#endif diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index d54464021a61..760fb541ecd2 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -2,6 +2,7 @@ config NIOS2 def_bool y select ARCH_32BIT_OFF_T + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_DMA_PREP_COHERENT select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYNC_DMA_FOR_DEVICE diff --git a/arch/nios2/include/asm/cachetype.h b/arch/nios2/include/asm/cachetype.h new file mode 100644 index 000000000000..eb9c416b8a1c --- /dev/null +++ b/arch/nios2/include/asm/cachetype.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_NIOS2_CACHETYPE_H +#define __ASM_NIOS2_CACHETYPE_H + +#include +#include + +#define cpu_dcache_is_aliasing() (NIOS2_DCACHE_SIZE > PAGE_SIZE) + +#endif diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index d14ccc948a29..0f25c227f74b 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -8,6 +8,7 @@ config PARISC select HAVE_FUNCTION_GRAPH_TRACER select HAVE_SYSCALL_TRACEPOINTS select ARCH_WANT_FRAME_POINTERS + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_DMA_ALLOC if PA11 select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_STRICT_KERNEL_RWX diff --git a/arch/parisc/include/asm/cachetype.h b/arch/parisc/include/asm/cachetype.h new file mode 100644 index 000000000000..e0868a1d3c47 --- /dev/null +++ b/arch/parisc/include/asm/cachetype.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_PARISC_CACHETYPE_H +#define __ASM_PARISC_CACHETYPE_H + +#include + +#define cpu_dcache_is_aliasing() true + +#endif diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 7500521b2b98..2ad3e29f0ebe 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -2,6 +2,7 @@ config SUPERH def_bool y select ARCH_32BIT_OFF_T + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM && MMU select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A) diff --git a/arch/sh/include/asm/cachetype.h b/arch/sh/include/asm/cachetype.h new file mode 100644 index 000000000000..a5fffe536068 --- /dev/null +++ b/arch/sh/include/asm/cachetype.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_SH_CACHETYPE_H +#define __ASM_SH_CACHETYPE_H + +#include + +#define cpu_dcache_is_aliasing() true + +#endif diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 49849790e66d..5ba627da15d7 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -13,6 +13,7 @@ config 64BIT config SPARC bool default y + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI select ARCH_MIGHT_HAVE_PC_SERIO select DMA_OPS diff --git a/arch/sparc/include/asm/cachetype.h b/arch/sparc/include/asm/cachetype.h new file mode 100644 index 000000000000..caf1c0045892 --- /dev/null +++ b/arch/sparc/include/asm/cachetype.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_SPARC_CACHETYPE_H +#define __ASM_SPARC_CACHETYPE_H + +#include + +#ifdef CONFIG_SPARC32 +extern int vac_cache_size; +#define cpu_dcache_is_aliasing() (vac_cache_size > PAGE_SIZE) +#else +#define cpu_dcache_is_aliasing() (L1DCACHE_SIZE > PAGE_SIZE) +#endif + +#endif diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 7d792077e5fd..2dfde54d1a84 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -2,6 +2,7 @@ config XTENSA def_bool y select ARCH_32BIT_OFF_T + select ARCH_HAS_CPU_CACHE_ALIASING select ARCH_HAS_BINFMT_FLAT if !MMU select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VM_PGTABLE diff --git a/arch/xtensa/include/asm/cachetype.h b/arch/xtensa/include/asm/cachetype.h new file mode 100644 index 000000000000..51bd49e2a1c5 --- /dev/null +++ b/arch/xtensa/include/asm/cachetype.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_XTENSA_CACHETYPE_H +#define __ASM_XTENSA_CACHETYPE_H + +#include +#include + +#define cpu_dcache_is_aliasing() (DCACHE_WAY_SIZE > PAGE_SIZE) + +#endif diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h index d504eb4b49ab..2cb15fe4fe12 100644 --- a/include/linux/cacheinfo.h +++ b/include/linux/cacheinfo.h @@ -138,4 +138,10 @@ static inline int get_cpu_cacheinfo_id(int cpu, int level) #define use_arch_cache_info() (false) #endif +#ifndef CONFIG_ARCH_HAS_CPU_CACHE_ALIASING +#define cpu_dcache_is_aliasing() false +#else +#include +#endif + #endif /* _LINUX_CACHEINFO_H */ diff --git a/mm/Kconfig b/mm/Kconfig index 57cd378c73d6..db09c9ad15c9 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1016,6 +1016,12 @@ config IDLE_PAGE_TRACKING See Documentation/admin-guide/mm/idle_page_tracking.rst for more details. +# Architectures which implement cpu_dcache_is_aliasing() to query +# whether the data caches are aliased (VIVT or VIPT with dcache +# aliasing) need to select this. +config ARCH_HAS_CPU_CACHE_ALIASING + bool + config ARCH_HAS_CACHE_LINE_SIZE bool From patchwork Thu Feb 8 18:49:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550326 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 85C20C4828F for ; Thu, 8 Feb 2024 18:49:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07EF56B008C; Thu, 8 Feb 2024 13:49:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E5D986B0092; Thu, 8 Feb 2024 13:49:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B54866B0095; Thu, 8 Feb 2024 13:49:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 99B4C6B008C for ; Thu, 8 Feb 2024 13:49:28 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 743EA120F72 for ; Thu, 8 Feb 2024 18:49:28 +0000 (UTC) X-FDA: 81769524816.08.D37742D Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf21.hostedemail.com (Postfix) with ESMTP id D64A41C0012 for ; Thu, 8 Feb 2024 18:49:26 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=G+MCYgcI; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf21.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=1707418166; 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=8wpHKT9Hi7IbUfkZ2WanEEBa5TZxfFZsQCKHq9VYM5A=; b=4YGoF/ch8wBjYOnw1s8JqFEz71jUGAyBGVY2qOMLeLUVAWEP03Q3i73b9n0bmkuBn0iV78 Wsn478FKkv1GV6e0mysjCl0WSPYCAQfHVg77AlDyA/Qx4AE+DF7NcvHnvsjqtthXKaKGqK EekooVRY/UweR90jlAQfl+PSKd0HPyA= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=G+MCYgcI; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf21.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=1707418166; a=rsa-sha256; cv=none; b=z3DQ/nAirm4IvgPPv+mnj+bbLmFvgdrH8usmchkB9GQEgzE4YWKzxxzfwrAngNoKfWdli8 YyAupflXD9DtdH2ciEeR1KVmJ/P0rEgZntKGKjMedcBfPUVtKdYDbI2SGAJ1TJH1DtmXNC AQFpqhkGkOGmKDuyzwPDJ/lVhmvvxaA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418166; bh=MgteUY0CjaNYCNu4ZJjdjfbOYQwaLS6hDEa6C2rXhOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G+MCYgcI7iOhUtOG80uDYEEj9WDUFtjZj9v5kigEOVyg1Gl0p5tefCTOJimzq7BIl Bntq03Tcm/N+e6ObNbaOTegq2ADAQ6pQAwKRVSja1uTLw5yeNuWK/hvvwPRF7XXbX/ M6nZvFFxMKHg5SQuBdBtw17hxlxVb8oD+kSkJNaegeMMMlHzHo5f/VuV5nAyz64Pyw A0gPrGc0Vnc/Vms7OHuOkBj+zaxkVYidiXOcY2aohU+UyZ2+NFyxkSnkI7UeA2jGpn EkUAuevUw1ZVowe9kZH+93MAkvXFLN/9+SJBI+P9oBDLUkZMEhunrIKZMVOfThz2S7 T2GUX150wzk3A== 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 4TW5cj6MmwzY5R; Thu, 8 Feb 2024 13:49:25 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 Subject: [PATCH v4 08/12] dax: Fix incorrect list of data cache aliasing architectures Date: Thu, 8 Feb 2024 13:49:09 -0500 Message-Id: <20240208184913.484340-9-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 X-Rspamd-Queue-Id: D64A41C0012 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: i4dxhg9e4zrpi41xa5iydm1jkmar8yis X-HE-Tag: 1707418166-651402 X-HE-Meta: U2FsdGVkX1/5cXTQtMFApRejRvpzmbRD00TJM79wi/RVsXAf3Yk+EQGqtX/984ycyhZZe5DeS174lU/XiTXKIm8aeduL8xRNGWAEtJv12A7OCmOUsQuAwIinoLuDVeMMLFKtolYpmcHM9LVNvFX+Qv111J30s3OzGflVZYm32g6PEpXgoe9c3ZR0dukIfeyyvWg/WvQ2iPP6/gqhuI6hOm3c5bDKFPxquj+J3oYhazRFQ4a8lN7wjwilM5HouVX2/G/ENxkwKNUtBMMPBz/3q947XBda6z0uvtF8Y2d+HopFTjTyRGaSrArJq+5jFqX3zGqA9XvdMdRZoZK7h3yLxfR+PphoOtK8biJxXvrZHJgtQy/VG6gopZCLaseP1/jtqMNiYimDFn03kxMZRm5CPTdb7tlTn6hshFzYHIbyztI1TR7xGsddmp2qiT8WYgLqU3f+jcg5bx5F49CUsdHK2vGV2joIi9ruP4pgVKUT4E/z0sBreKHHX5feqpgmD4h69SNlfx8DxiJ911vNX40r4y0RB61YkcDbVGdOvzJQ0GB3q87Bo9P+RXyeVSjKSfLHRFmYHpgJ/BFOwGm1sWI2XcMiGBuwsaEqKU5kJK32A8V0LNzjvHaZZsjETY9PQCrRmGioumx1NS89VHWN15ArYc/HbDoOc5mNdxXdeGkGC049hzwIoAuBR4YaYwU3Ilu5vZMwqlypu/ASO2Ja8g2RhcDiQzbwV12tJ59xtpYv2qCTeDfWV6oQdzbk3cw/8tJvL/iwqE1ymSx96fMGZwBKPjj5/uad6Rti54ghirDfT8yYRDeCQYJfDJTZxXx31/eDgWVQRIAUV7poALMs7xRCjAXXEWJ59sxH4slKVAiDK1M7OVjLjnynMDMy7UMVHeRPSye37jF99G8TBpE+RWX5ejX+bTnfBO81fVkntkwQxXSDlSUvfKerrczMK81A4UyKHZmKYyPP433DhRRUGr0 zsUIvOf3 cgBvyFFFQY2rf4OkUT3sqYK8I0InRkDJ0FQHqxTIpYsKypKGk8X9ZpUQr16mlweeNK528tI2NJ3C2+VR5UbEuLY7tW4yszFVIOW5bs65/tHfGzzKtWGYhW/vOuqHhFmieoUZh29eRcVjSMtxEPLh3N1jzul3iINbwqYHHEbKJKV7xobX6T+N3alTJh4aHhMJbJPlx2PiVr4u/ESd9YwDjTiJtyjaj3PruAH0/EOasciC7bFfYGKEsbjJ125/VSCSCajZI77yn3w8kqVC/lwObBEGizcMF7EmOPumq8MHxo0vxuvTvmp4gmmlwE9qoAMRWhnPB5A5FqYrJxdWE6JgLGsWwbCOSUdxb19SH4hUwrVzzdTnRxaATW89PxpKE4MamP3rAfsl+ign1Ap5VeBiXZGcKyvhILmptOO9hEPSq27dxDEOpihliCC2uYMZRo5aPKwviOK8AOgj7yDdaZDJIOYFNXSLbTVPOUIYxKaStQJkBMpbxyAFCsze96UZRPTbmQMrT8UJjdLG134jKxnZCwMs33zc3O/M4rTI8LbHx1f9NKGMs6jNUdwNtjfRNmph/2vmC 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: List-Subscribe: List-Unsubscribe: commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches") prevents DAX from building on architectures with virtually aliased dcache with: depends on !(ARM || MIPS || SPARC) This check is too broad (e.g. recent ARMv7 don't have virtually aliased dcaches), and also misses many other architectures with virtually aliased data cache. This is a regression introduced in the v4.0 Linux kernel where the dax mount option is removed for 32-bit ARMv7 boards which have no data cache aliasing, and therefore should work fine with FS_DAX. This was turned into the following check in alloc_dax() by a preparatory change: if (ops && (IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_MIPS) || IS_ENABLED(CONFIG_SPARC))) return NULL; Use cpu_dcache_is_aliasing() instead to figure out whether the environment has aliasing data caches. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 Reviewed-by: Dan Williams --- drivers/dax/super.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index ce5bffa86bba..a21a7c262382 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "dax-private.h" /** @@ -455,9 +456,7 @@ struct dax_device *alloc_dax(void *private, const struct dax_operations *ops) * except for device-dax (NULL operations pointer), which does * not use aliased mappings from the kernel. */ - if (ops && (IS_ENABLED(CONFIG_ARM) || - IS_ENABLED(CONFIG_MIPS) || - IS_ENABLED(CONFIG_SPARC))) + if (ops && cpu_dcache_is_aliasing()) return ERR_PTR(-EOPNOTSUPP); if (WARN_ON_ONCE(ops && !ops->zero_page_range)) From patchwork Thu Feb 8 18:49:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550327 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 41096C4828F for ; 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 ; 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 ; 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 ; 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 To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka 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 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 64A2F80006 X-Stat-Signature: i55gej4bydug53t8b5gbw49bwiromydn X-HE-Tag: 1707418167-890702 X-HE-Meta: U2FsdGVkX1/bMGvon5skCbhWXrhJvo95TJB3Kp/3IkBrVhHxex6SKAIN3KcigLxsG+TfVqBWaA/vtB1qMU7iQ7nskeEDIB9s3iHdy0TbrALwahjqQl3C63blSi4Y3iUvQwCr3mLsdJycBBng/7abYzB7tJ1lRzw5ZShpo4xkZEaM0IuVg018UPlpKk2CwxwZUlXpO0R+itd3jtyh3qjt8c7PMUp6A2aRNt/tiyLi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qq+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: List-Subscribe: List-Unsubscribe: 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 Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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(-) 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 { From patchwork Thu Feb 8 18:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550328 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 BC17DC4828F for ; Thu, 8 Feb 2024 18:49:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC9F86B0092; Thu, 8 Feb 2024 13:49:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B28FD6B0095; 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 7F6B26B0093; Thu, 8 Feb 2024 13:49:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5F9A66B0092 for ; Thu, 8 Feb 2024 13:49:29 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3DAFBC062C for ; Thu, 8 Feb 2024 18:49:29 +0000 (UTC) X-FDA: 81769524858.30.E8A8171 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf26.hostedemail.com (Postfix) with ESMTP id B4BCF140003 for ; Thu, 8 Feb 2024 18:49:27 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=TAhR2aeh; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf26.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=KpIeJCtijrM73f9OPspIzpr8WVUCcFb4k8cdX3WBaUdJf3fTRCiRvJLo2ZOZfleXKAHa1g xbbAIMbwdLzR0WPOc9dGDnvcMTZfxEsIfjtpaEhQI6Ro/kzCsjJhCALvBD/X9v78ImouYZ B1u9yj7KbyrM2CQczrdUmgAfjH2cLjg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=TAhR2aeh; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf26.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=M/l3w5J0gRKX2dpYvmIz6vr4xoT8EtwTyWYFokXaqsQ=; b=Hvl0aevw4/oRYrg1LYv1aIHSsmQpXA8fh9WjZtLm17w0heIWUacsOkwyLMI1BM/VGi1pVx rU0LX1Wi9/DyY6uFn1/nww8VcoajMjjiBYFrlXrNYifMVUkVUMLUecZpzWykU4sgH/VJ3e kE2J22W7JREnWALHDhyZVUqOfHDDvoM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418167; bh=3qwtk0TzM3yqkpdWTkMn8G1D7Yvm6JJDP82nQNcfpzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TAhR2aehSVIy+7kxOHR6NVnmGYlp9kd5ycnTSBAI6hceetyhQOWUUfcm/nFiep+a1 kEkco0j8ZB4aI7AGUsK7I6wOE9xdzR/fBQB/pGe+tbFE1K6mzmAeXB5d7S7zA0bRWj ip3Ju2dZR0HVfK7H2Y2FckrBH/MiPVeZX1zh4NiDcc1BLONE3/lFUOu67rYwA1XBw6 zqyIy2GXXYMOivh7iSp4mwMGUu1002g4dcG4icNksUO16LHayffi2x7O5HtglehPmp B5lutv1FF5uLG4qLTgKWQTdXfMpywAxesrzwZXGsCyTz/972b+6tAcEMA0N6RREPQK fjRsnlrFyE3ww== 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 4TW5ck5SmGzY2M; Thu, 8 Feb 2024 13:49:26 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 10/12] dm: Cleanup alloc_dax() error handling Date: Thu, 8 Feb 2024 13:49:11 -0500 Message-Id: <20240208184913.484340-11-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 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: B4BCF140003 X-Stat-Signature: h9wsa4tg3k9qo5x7yq3xwrfrxfa3zm7w X-HE-Tag: 1707418167-285092 X-HE-Meta: U2FsdGVkX1/MKvHGulPuiJ2GLP3sMCxqGKbamcegJglrlntSDcFlPTVFB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TGS/8h2CFTMIfxNK/M/MXFhozNONXr+AnxMJZFbBUQoNIP1ESSqTgMmWwfsUkwSo189JAEM8Q/1bALLKe2oV1Z0Lh/MNEuU1JG0tIM6Rigs1BKrqCmV67kxga1MhnRTons3LigdKmq80X8nWYT/63Dk1cX1tNOCAzKGx8++ayvob7d56UBPrWp5eIw5OXNew6oNUA5tIgetP+ApyZoZ8mLswpsdzQdOj2ykvplveSiYh80x/Ur9AfRpa7NsgKrVXfa18QGOyPtLjW9qjxnnPC79Ezqh9BTp8PERde9Bluv+2zGvzk7lUyNmGo7S/6qhTGvOoZFk8EVGy6scMNyz6yzIsZfdaZK9U78DsVyznHde4Q///CYP9QmZDuIry4zaOMueiuFt0oA0IKtFPaDG5RYT0YqAKGXAWAxvXuz+KsaTijWnit9oCvZKZvD0lA+tpKIi+KmcTO+dEm4wALBHniYswyqFM7P9dnRi7r82/gQiE0rUJw8rUep6uLThavNParw86w= 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: List-Subscribe: List-Unsubscribe: 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 Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2fc22cae9089..acdc00bc05be 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2124,8 +2124,8 @@ static struct mapped_device *alloc_dev(int minor) sprintf(md->disk->disk_name, "dm-%d", minor); dax_dev = alloc_dax(md, &dm_dax_ops); - if (IS_ERR_OR_NULL(dax_dev)) { - if (IS_ERR(dax_dev) && PTR_ERR(dax_dev) != -EOPNOTSUPP) + if (IS_ERR(dax_dev)) { + if (PTR_ERR(dax_dev) != -EOPNOTSUPP) goto bad; } else { set_dax_nocache(dax_dev); From patchwork Thu Feb 8 18:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550329 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 30876C4828F for ; Thu, 8 Feb 2024 18:49:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EF356B0093; Thu, 8 Feb 2024 13:49:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 252086B0095; Thu, 8 Feb 2024 13:49:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CC836B0096; Thu, 8 Feb 2024 13:49:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id E4A1B6B0093 for ; Thu, 8 Feb 2024 13:49:29 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B75F0140F48 for ; Thu, 8 Feb 2024 18:49:29 +0000 (UTC) X-FDA: 81769524858.25.72CBB96 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf28.hostedemail.com (Postfix) with ESMTP id 2A756C0007 for ; Thu, 8 Feb 2024 18:49:27 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="bRoE/7ia"; spf=pass (imf28.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707418168; 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=86cxj+xCR2VKZSzMElfFRPicz5DfDFyVUExhe2tu2h0=; b=Tf4S/NOQ/ToYFDxTTub65egKkvNj8qsskiXL/ta2bmM8oo7/82rBTXf8n2jo+lAnUoRIYa cTpvyUAF4y4QR/sgtGM+LrLfuabT9NOiZESzKPZg/bX/F0IJC18LT2OOVXRXJJUL7ThgjF YKqB5RmD9AJsQ2QkyvCz94sqPXWXgnQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="bRoE/7ia"; spf=pass (imf28.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707418168; a=rsa-sha256; cv=none; b=FYGrkj+qKMMZNY0+NXMNEhNSCaBJFNKnV6sbwhQMbV7s5HP+7TiJiTjiMkF02fUKs4c18A bk7rba7eo2ln/WSAPbhroBULR9+B8pciYsjCQrdiegS4tDqUJp4yup1JqpSAWGPZwS7JP0 iy40Ff7KA6qghfh4ZlwqbzPSeFj2OLE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418167; bh=oenQ3E1qB1jTPZO/gOZI9CMarWIZCEOT7s/3o23TNGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bRoE/7ia1+B9bPI5yF1PR2T1XA93zIRBnTcH0eC3l0F5DKqYSeR5Nk0tY93pHHcMe SB173/Unk3i9YjDHq2INIyynyUJBpjhZxr/0L5wI/UAMDPahLp/TVB7Y5vIH5N5AE5 crMulQ2zXJos7wtuG6cN1nQG0cu1edkRYscl6pnAbz3KIhoZ8H50j2WoCr0/ks/Omt UUlXIcysLpTzkhjiT5Iptlazn5vqIFc3f+yfGuUzmScLfFjYAiJ1vOAPY4DDm2eyWC 3cTHV3qAZzEPVR6WjB/op0ynHNQPoZFIweA7jAiVScoeq13l0Lfy00tVuzsdsZm7a2 9S+WBZwfWHPmQ== 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 4TW5cl1F3pzY5T; Thu, 8 Feb 2024 13:49:27 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 11/12] dcssblk: Cleanup alloc_dax() error handling Date: Thu, 8 Feb 2024 13:49:12 -0500 Message-Id: <20240208184913.484340-12-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 X-Rspamd-Queue-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g8MaAu6+1oaXWhI0XYVq 5sO+Z3fJ 4Gsfx7+wydcl7uruGAPGDUqcEHBXU663eoCJ2krcn8IRA/OZlCTj4klrRAp9IYhRfcPcUwcmbUJVfbnV+olzTwtIMEvGHnM7dDBucl3+DkEzJNAH76DnObUayflhFrT94VSggZqzlvECmMjkam92C/SJeUU3ifSmJbfk3SkVl5wTt+LdnrELoKk4d1hVz6qhMlpkBl//H6XJHpM0q5CzM/Gao1ZLk7xukzTxMIpN7pBoZA4FjI9JTZZ9fQWBFztiuMugpVZj8zKnwSRvne5pyutI5fDX5d6Mydg+1jgcNjVxx13R3wRrdsz92GOy/2seeDV4Z9O1Ane9OSYjZShqIx2epygbRt8OL76L1KYkiOsC60cP41/zw1glg+dH+4ucUfTNv+REkW0/xbanj/KT8kL93VUpwoNt+y2oHbq4vSgOBoVjfQ+HNwxqY+PDdB5dW6twcF0L1eUfAr14rd6LZeigZ+55q8F9rw788o+sKoMl7qrtlk93mRw1sAGZen9mM0UXrDTII06RVc31NY0yJeGxTp0YO1U6tIbZuW6WvxbUQgqzDfpZ+ZDfHQchTpVoNCNBijFTQWHcGQeQQ/NWkFNhwpkFOxDj5GSMFP1apSRIyD/vFtvF2LfPEGRXm9uiEOGUJDErXH7Y3gjw= 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: List-Subscribe: List-Unsubscribe: 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 Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 Cc: linux-s390@vger.kernel.org --- drivers/s390/block/dcssblk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index a3010849bfed..f363c1d51d9a 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -679,8 +679,8 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char goto put_dev; dax_dev = alloc_dax(dev_info, &dcssblk_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); goto put_dev; } set_dax_synchronous(dax_dev); From patchwork Thu Feb 8 18:49:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13550330 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 F38F8C48260 for ; Thu, 8 Feb 2024 18:49:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 893996B0095; Thu, 8 Feb 2024 13:49:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 81C886B0096; Thu, 8 Feb 2024 13:49:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 648E46B0099; Thu, 8 Feb 2024 13:49:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 384B96B0096 for ; Thu, 8 Feb 2024 13:49:30 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 108A9C0F5A for ; Thu, 8 Feb 2024 18:49:30 +0000 (UTC) X-FDA: 81769524900.22.AC0D74D Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf27.hostedemail.com (Postfix) with ESMTP id 7928B40009 for ; Thu, 8 Feb 2024 18:49:28 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=FUBQbuoc; spf=pass (imf27.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707418168; 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=5aeSBiqeQsH8ed+NrPkel0B0yoku1i9OKo7qCr10U1g=; b=Uc6BPltxYyrCKLeBe91M11Aut1TTb636VD8sK2E51sM1rF/fXQPi4tSCWHCpLB3DwvnzIk NLrqzj2q7Ep6Wkv7Rrn2jIiqVLpj6qSHkrh3zFomN3tosI64XpLbgE/WewJ/DaES2BnKqo Ju0c81Ov/sxVFeTc73TX59FboGXw8C8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707418168; a=rsa-sha256; cv=none; b=D2edz+TqzPIUWdUhLgY175pYdycEf44AJ+qiTjgHTL+6Lz1DUGslcMuOWiW8jnkW0cpmi5 lrnhggO0kDTfEoN+XmmSo+oThRjwMgTnKlByaKCcFEbm30UuXXycfoAHMEFZ+2SWEgGW0J /IoPQW2V4AnA1qJ7vsjkWxAVN4OvRos= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=FUBQbuoc; spf=pass (imf27.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418167; bh=umcqlnyoni1L+YV9DQVqbsmdwpCSWY7IqX3VvZk7A10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FUBQbuoczWUo8k5+ANycG5EnwK2AZwZz+GM2Uz2zImOXhkBzFtGTdwBZAYCenP6fC DgLffSigWmSC0rW6EM/A/gCcDBjQqYAWbEiusKZCP/jz+pOnSPLQWkJpy21cC8SmOh 7iFVQnDrBxgXCvAMOSe7hVjYTOmI/BykW8ePB+qiKPACpJtReCrtD81c1ldvkSSgXY 169iBhHYQPa5LIPJ3/XYMbbPDKLgg7sPaH9XXE5MMG0A2HDed+b0Hbw+qnFFAYipQh Ks5Sbzoa+ogU/4NEMlev5PchVfLYxH7lv49QChUb5wmbf1476V86H9j9CkdWhoRXIX FqmNBGS/mqM+w== 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 4TW5cl4DQpzXwg; Thu, 8 Feb 2024 13:49:27 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , 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 , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 12/12] virtio: Cleanup alloc_dax() error handling Date: Thu, 8 Feb 2024 13:49:13 -0500 Message-Id: <20240208184913.484340-13-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 X-Stat-Signature: 69xnapck9azk4pextw3g6fpd1rbp45ch X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7928B40009 X-Rspam-User: X-HE-Tag: 1707418168-72904 X-HE-Meta: U2FsdGVkX1+O8Q6IeJrvrOqOui3lxJ3L7fxUJ6vbjdRCfsDKtJVGmHQ3L6UwfFtGhOjWI/b/J9iq/6BxMPUtEbFsqn5KOAJR2SZsJtYTDL2lm6wLMvcaeOkY4mGcYzZX7EMm7c2CsTFfvh6gk0RuPOiSuIQFxP2OJtDXMl4ysjFRUGx4WHsvAHz9sYnSkw1Ii6PTCa36H9nPilStyHm6Ql82V0lX9+VaSSyc/acH+69RKMBsWP0OOcGnK4iV23FdCWhlYz1PXZPACevdG3EM0hOoC5QVQXS/3Oo5UtWF6/KRMpwB/8F8jDlPzDBDi3QxBmejGCKiR+60fnBaTaKDA4TZL3YxqQJsWZGC+3UTdQeNlx8et8wHk4NRVunpoKdCyvDkAStS7obVumQAhVP9J5GL2CUG+OdPNUmIRxPSfgX+QPvye2Gu4eR4USK8+9iO265u3HEEUXPhsPfs5UFGiCN3zw1upgaWn/Mo+mhRUYViEXNPRNLWaL6jwVefyt7NkQz7x8B5+4Un8iyYgLeQz5Iy/Ne5lt6MMZmFAkZp946MSth0WF+0uomGeZqD5zrM68E7l+8bTbgw3OQjgWUstDX2EB53G2+WjXDOnwUQi+9cBOdAjvtOcFbKxpc0xkwS5ikOkicSN0s7qcWeM60s9JhMERe/hrQzNnKJFkOT3bLafTxyvr7/gSZD66mVJKhtJCf43A6KSSNIekpRDPJwKqCWrbXARN7aZmtVZT72fvn7EDnFdnA4p/KpRKqFo98e7EZkLswLhy6XyPCTvZLKwT1QVz4RiUYEh0VAielf5W8yC7phcXmJC+UtrL/zMKb9th0A+kbyGhJeueMX8Z4+DKVAIiA4ZhHkomkwLKpQD2yk+6DR22ASnBgXlYJJz87+Ng4ryjh1x90WcW52QzZo6Qo+MRs+j/lfES8/V93gEoZghyuhshRFP+ntpTkcXAgwiHhDLa/66joRLvj4FLR kT7Vui/a cJYEXby58smaIuwGBmhkw96HtpoxCl9jCQ24Q52l4zRZEzJDwhlG0aiVgxK5WRKXtaGdVPTG1bXKj2HPwl4mNwpLHly7UgPehLeXo2CmHx6rifBkE3Kg1tpOeePfFsY2oSqGHtMuIc/x6ynBYMSTUTMeW5YwP6NiX3aUuGuCVTgXF9pPcB0dvUVQw6mA9PoLIeu0uVfeFB/J9XexDUqCvjAn8IV0emfn9PO8d1hrtlO3g9NiE3rc/W0krRe0oMn33dBNhliIbL7su5YBtejqqkeFSLy7a7bZgIOh+ryK7+wq8WUA8uvLErJnRak6ozbWXV4ND+K6N4nBbO0onZNEDALGf9OeAxxm2zW1pCZxlT2bMvWkcoBQYDzagnfT6RsBukHCSa8DpOD+VevjgnhB98e13X+1eJuN9dj5569LamkRL3Dq7+U/LQDtf+N5f407tjXXHrXuK75BtTdzJOCGTXVfO1qFuDbZ0nEix/Elq/BXgCdcSfysO3CA1YFYLMy6SY6q7sCjGujeb82D+NNutjLCuixdjMBD51bnJlxy/SooLObGf22jGM8olbDd1hVzgoXq4s/JHR133jD8oKdSRoJ53HJfn+40q8pYFl6GgIsXTFvTr3pwGm5lJGjuJV3EbBIFRL97rhe6/NrM= 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: List-Subscribe: List-Unsubscribe: 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 Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King 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 Cc: linux-s390@vger.kernel.org --- fs/fuse/virtio_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 621b1bca2d55..a28466c2da71 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -809,8 +809,8 @@ static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs) return 0; dax_dev = alloc_dax(fs, &virtio_fs_dax_ops); - if (IS_ERR_OR_NULL(dax_dev)) { - int rc = IS_ERR(dax_dev) ? PTR_ERR(dax_dev) : -EOPNOTSUPP; + if (IS_ERR(dax_dev)) { + int rc = PTR_ERR(dax_dev); return rc == -EOPNOTSUPP ? 0 : rc; }