From patchwork Fri Feb 2 21:00: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: 13543399 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 4D5B2C4828E for ; Fri, 2 Feb 2024 21:00:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC3CE6B007D; Fri, 2 Feb 2024 16:00:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C72C76B0082; Fri, 2 Feb 2024 16:00:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B148B6B0085; Fri, 2 Feb 2024 16:00: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 9BFC36B007D for ; Fri, 2 Feb 2024 16:00:30 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 034F040FDA for ; Fri, 2 Feb 2024 21:00:29 +0000 (UTC) X-FDA: 81748082220.30.1996167 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf26.hostedemail.com (Postfix) with ESMTP id 3440D140002 for ; Fri, 2 Feb 2024 21:00:28 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=olkQ8vHB; 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; 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=1706907628; 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=Eln+sTZ3lWbYe1cY6QxgJrSUFlcl1HkdvOLHTqfDYm4lKWuWbLG/vYAMHw9GwsRSpML1ol gmiLQxgICd02nCGZBEqmpGBpM0J8/ms4C9qgRy8EcO69Rc9c60X21pq5aAFOhOj1yHNiT7 q+vmJoZXb6j8jAPyxL8cpWrfsmdhV+I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907628; a=rsa-sha256; cv=none; b=Te08PnrKnz69AxQuWvAR3jwWJBVEICEjaVGaTTmuxicx+oE+sb5TxpytvUKbDxBg+hsuuz IzvZPLMvDQg5yYvdZOFfgXwTnEBSCLEPNRc56XI3qVUPiJX9sPLPYjepllqMEHxYbJP3Iy lW9VZu/297ui/LcP88HhVsOZx+SsgZY= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=olkQ8vHB; 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; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907627; bh=C9trdHKUBo0wvYK5DBzsNfOU9QCkPyPGO5T7CJRyOKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=olkQ8vHBDWpgDSm0PdwKANERNaZOsyNCOuQxCFFGVBsLD7Ag/CgydWr3+PnCboGWb +hIPSsfeUgy6KlyuCCuiuPfERsK/mtMVZeN3F6hj24iXvLlqHKvWVMnhN+ewVfA/AA 9dSCFnRtTxiVUJqwb3fx9CGtZtzDHf3fYXJLNUajd1vzr7dv1k2M3iWpfI25zwFG2Y 1sm0tOKrJZdLKX/2FhGszkqnQD/SyOyzGMpy77l8cbhKZDwxeWGl8+MLyS8GNQ1C4F KSQLZfAtqgBbSQzv5qJelyGnvDGQfHgCKVKnpkAWAutmUaRMOzjk4YKBMbe1yJBvkG KJbJ7UojvG1Ww== 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 4TRSpg0YQmzWvD; Fri, 2 Feb 2024 16:00: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: [RFC PATCH v4 01/12] nvdimm/pmem: Fix leak on dax_add_host() failure Date: Fri, 2 Feb 2024 16:00:08 -0500 Message-Id: <20240202210019.88022-2-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Stat-Signature: sg81fgt8agbx9jquyeh1obe4iudwh5xe X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3440D140002 X-Rspam-User: X-HE-Tag: 1706907628-430374 X-HE-Meta: U2FsdGVkX1+dM3oxRANzOqLvb9n58vWrW2C5KJtUSpbKp4rpProKP/+6ywZ70mENdn9BtkJuROuYKHTIZWk1h6Z946sTx2JdGbqh7sEwf6DTyHBOlrkQd0NM4I/j+6TxOJWwdpWXk/UWKE83g2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li3HgZQNRz0k9wWqDwTbDCHTOG6871X5PbBEir8YVzcAWt0FRqPmPt9o6Xap/0GvIslHKUIz2toMP6dolBT06eKbpokQJ5feIgIu/hP/dePElf9bl9ErW+0YEiVGMNRjEvc7FrbiPmaj3FJ/MLzU5nwyxnYAnfPUu2NhEFKtfjPhwyRggybdO1vZsVk5EU1nTm7wEgHOxP+jixfNLj47xzl4+OUt+wZFDsutQJ/GiqaCDzW6g1T9y4VyOHJaz09/7AwCflk/N3Ded5oKULn2iXNdtnQp0jSuftToXmNvtndpgFzlSYNGQn7P8paDD+s48Gn0n1aPch8r0HmD3xL6p+ApIx/4WveSe4tkXCMiiBhR1oaCiO8MzbZDZ4SwVErGuPfurkOfBUVdRUM/OplVyr0vIkmaw= 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 --- 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 Fri Feb 2 21:00: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: 13543400 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 8F946C4828F for ; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3D416B0082; Fri, 2 Feb 2024 16:00:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EBEBF6B0089; Fri, 2 Feb 2024 16:00:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAFBC6B0083; Fri, 2 Feb 2024 16:00: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 9CB8F6B0082 for ; Fri, 2 Feb 2024 16:00:30 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 55A9614077F for ; Fri, 2 Feb 2024 21:00:30 +0000 (UTC) X-FDA: 81748082220.18.48DA9E1 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf08.hostedemail.com (Postfix) with ESMTP id A5DF8160013 for ; Fri, 2 Feb 2024 21:00:28 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=SfD+9FBO; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf08.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=1706907628; 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=EaeIJU45yyVkjx4YOU+q21nLSrNlbDEQEujle8s8CT3kCKF+RSn3+4cT72XsBf/W8nBoOK TF0lgVmXdETEMBQ865MNN2tFTFynuZABJxKWbraQWpYpJE9D7oCOLMeEmMvF0ENg622DYd ZCS8f7V0J1B+/nSYsPqbthxzTFXauis= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=SfD+9FBO; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf08.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=1706907628; a=rsa-sha256; cv=none; b=B0YkHcm2sjssW4swAG745R7tzKmZLoGDjzJzCx1bZgyVRJjmxulUJhFk6w8mzmdwwmtgmR Z6+M2uwf0XtGS4xv7zB4L5pj8laKbMEQW3ZNK8y1/a2Dt7rIm/gjjtqcpuLvGwdlsRghfP eIUAYC+CE6vav7KzW8oJ97AsPune898= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907627; bh=NdQ4OmFkV2+G2H8B4VkXTCxDeM+TIHeVIiPEQVlM7R8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SfD+9FBODsvL9YxlK1eefFmH2Hjg5R7Nm2c0c/fiMmV+KMkEfMgn8fwXWEqe567tr hitR0HdbXa8MBPzXdEQAfPlMmOwmhspx1tBJIONQneKlE9TwWJmkzfjXVdmBRroRoc tjILNBX/OBLmXaCizqF3wbdgWKaqsoQBmA0IBcR2qmBOEZHO6sI+lwpuXk3mpdXWn1 0wFeI3QK26ekNegrAv+Homtya3de6AuOl2OXBg83Pb+HUc1wnEG95Aq+dFPABMDzZX A4jobyF0SFA0vRkB0HcB8gGIiRsGKsSNiGhvGEQux2MIPMvpIBgiM+92vhzg7Pf3gh OJnjmBEQikO1Q== 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 4TRSpg3hSPzX4Q; Fri, 2 Feb 2024 16:00: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: [RFC PATCH v4 02/12] nvdimm/pmem: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Fri, 2 Feb 2024 16:00:09 -0500 Message-Id: <20240202210019.88022-3-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: A5DF8160013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: kju97knz136f8g648xmxxu7i76iotab6 X-HE-Tag: 1706907628-225341 X-HE-Meta: U2FsdGVkX1/qA0Pg/GARgAA4p/YIvcU32SQ4ipjLiej7ECuYFgDg8Airqfqv6uUgtDWE3dBg/3xo/LbjsUpEF2qMIb9Ck+/dMuCCxtEc/nj+VV0wziYq/dEF1jKnuJpuaw+X1XyxmS5hhzz3UVHZdB048NGUHPX12y3LqRcDNYI/NhvIXITgMMvtBT5wulT0mleMonx2yZFaD04JyTzQcr2hGMShyxZOcLfbWFMgbqt9rJD0JHmBdCifMjlxydSp2wNH7b1vMYFKL+bvPOu7iLuT/9h0FLNp1tz6t0NPSRY/eSrppNqFG3tLkkhF10lvI7lUMBCzu1yj7u59MEe5WBY89Kmt0rqCmlXHwMvUx28/C6IdfsfeW5iTsc6nOPgbpVI9o3Fz0qBt2ogRpFyPu4uOLxrWcU0paXPwmbUL4Ete4/mcFWGMfab2sMpmlXx4y0g0LxuxKNYIjCdky/gdsLDPetjgoX3YtlcmxeXkVJIWBKpLuPFvSQpNTLVLGLb8seU17pyajl+ge7A3gUdJ2wubh8QUUuRCnT+j0vKdMYhrSVoegt97xxjEE4hWag/smtNXMQloptPo1+T+euEIdayA0oUS9q2zgMsZzHrIFd+p66XVmfgfC721+dB3aoJDi/VPJgMSFoebx+HofOogTMn6FCDMW9W3XMtQ/qewzow7RUTBib3Squw9uJmuA5F2HuD/YEZh0elJG5dfUy7yOkh9kGU1dwBrrWWLSczGj331K4pVUKDlcwjZqZVmhfQBSt4ykpSFCEBY2CtHNYHju3uDDynWjkVWlqaY0+WPTCFqHGlP46rFlBcgs/QY32AMtWav7B7NHz+skMDcu2n0m0ONlo/BXSokw4bfqXUEol6UG2xXUyB/cHBR3kOmlsGBsoTq6ikMzMixI1VU9DXIh0fEJ6puCVvHJTZkOlYdj5fX+fxiuOObEyRm/kLakOz2swi2ZM4prSl0nR0pbEt 7Kz7PAqA A7Elu/0XpwpYOmQUoc0JoiQQsra23wvRWKy0wrn36IaPoKD22nZC6KFZjWStFhU+uz9fu2AdsKXYcu/6dyMoL3yp07bTJpHHjLGTuUGP6sNS8KYxvpql+MB1UYC4BgWxTYSxf0kLF5PsFk41ZheP7k2d23MyxBRbLr8XQNJUFOwGRjJcA0FhA2ulYYxCYnKevb11yJOmZFRlV1X47aUrd0YIvDf2vQKH5qq7kPfGakkbTT+OcRJTMed19eJ6MWFcCzrwqchuhrm5SDhZApD10SlmuluVl8//Fh348EVKaYaO4YZUCjjavUxKLBa46guQqCCqAgwtrVBBD9OLpVhta8ZMdvQsMawbHb5VbDjGqOnIZtxkcfLOCX+HO0RzgiItEoAXW5lqj2cAsWs755IQ1dy8Es/JX5OHHFNTP+lFeB2lHqRfsKnJYQbp94FCL0oRJQ8yvH9ZWtRyr4qm6Vn7LTPgWd+FQ36njwCKW6JgvP2MBzLGL+CtNwi+//aFIvKPkrYZPJhk3jpLQxpq5vzGETLpjviu0KmnQkhYkZ6ue8yADf6cCCo1JYLXAYV+QgkY7TkPwt3Msd2qS+ZrKImxvcFUVhWRYLd6fWXiJXW1T1NiWaktfTc3jySrffrNuOB5TPiP/tLOCTC1OLo4= 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 Fri Feb 2 21:00: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: 13543401 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 C5C00C48291 for ; Fri, 2 Feb 2024 21:00:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3EA196B0083; Fri, 2 Feb 2024 16:00:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 399DE6B0085; Fri, 2 Feb 2024 16:00:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23FE96B0087; Fri, 2 Feb 2024 16:00:31 -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 DBD256B0085 for ; Fri, 2 Feb 2024 16:00:30 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 78E2B14101F for ; Fri, 2 Feb 2024 21:00:30 +0000 (UTC) X-FDA: 81748082220.13.8BD8D45 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf14.hostedemail.com (Postfix) with ESMTP id EC691100029 for ; Fri, 2 Feb 2024 21:00:28 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=n4HkiezO; spf=pass (imf14.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=1706907629; 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=x05fLdGSvymvYX9L2oV2NroYpCXiYGZnszD1Vl0ZlS5sMDeWNTG7bsix5PYUtANkwbNvsi 3xQYffw9nKiheO50/zmcxemuvMTd19JM1sX4inxFjyVfcBF8URDnFzU2hMQaN1wbZ/F5bH 9uZx3HLTgXSV0YWooG7QXsHJgasEVGc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907629; a=rsa-sha256; cv=none; b=ivzgXt3Ub0oxxPuWLOd7KRUZcxyPIn+gyqZOC2fpYV17KIJUAELLFmTaUBqLnbwQAJBJ4S ioB5jLwlN5Z33U0/fmTem+XCwREEL0Y8jj+zkpHuRyCExhuFnZoIyLYKDpKXAy15Rtvp8t oxraSl5/Y8c7EoDr2k0sHucZCPKmEfI= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=n4HkiezO; spf=pass (imf14.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=1706907628; bh=Cw819/KonN7FOZNMfLR1Ivonx2xW8T4iDPwkWkOj91U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n4HkiezOBThhr+L9DyyXZNtQ3AYY+KR7/dDOpldNT1ICN9K/vq3hURiBfP3xjrM1p OiPZ/R7PyOXUgy+yZquxsBjeck+wbRSmQ3FvrpnUSNOb42bHSDKgFQFfZNXM7fZtl+ Ja8yhxmPfFMLTJPyiUNHimX0PAZY+I0Ga4qkzZvU/SoxsvOF4UCbzLwcMsoZOwniLF kyD8uDpxesxBAC801OxUQlPOCQSAQ96tAYfxVFNjmJmPTOEk2N7nyZovgqjYV+lsrz VMrdnB2pvEWd/t6vwTYj41rnS9ymkzrXokyLekwB22A9AkKI5X+WUX2IxomFfmazUt vrYQOPhPSgdIQ== 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 4TRSpg6fNpzX4R; Fri, 2 Feb 2024 16:00: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: [RFC PATCH v4 03/12] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Fri, 2 Feb 2024 16:00:10 -0500 Message-Id: <20240202210019.88022-4-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Stat-Signature: 673estd8dmyj84ex4gpogcyqhnw6xj98 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: EC691100029 X-Rspam-User: X-HE-Tag: 1706907628-403978 X-HE-Meta: U2FsdGVkX19WQy/3Lp6PQ3iAYXflojmCdfkDj7q5m6ks6wH5/xVziWxjV9yq/66GA85OaROTcoUtOvrXjFQyW7bzP8NYhbTWp9RkV1ZDRW4IvOpiwr9nGOyou5nXg+CG7i87Tqm++Q9p2sZlQm1lQ9ENTSWUhrnUDAiv6muv9GB48eCwmqAC2RsaAChbHqXiMuLdFIZc7KJZzt6nlAZgWr5QvhuhWnKhnh5iZR86wlayt3PdJKoQz5sWm485gtFDwF5RE94n7tcE9AN1fbpx//Iu/B+7YIZNH/VZ0XsWaWX7pDmrs0ckOAX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u5tMyd0JtVYLrPzmZ6dT2fr+HbqhCiDq82inPCfticj8+iS7ut2nrCRyfFFDQIg9F7LSDW/8PpYtWfp5b+0C0OoJ2NSYQ7+zJxy1/ikOMO4fMA/m9kmhvWragXoa1Goix419DP6ZnwbPGJfuj0tk7bR0D9pqjD3JBqygJLXSo5zwJBvWY1jBHFpijviiJeearSFrXw6lbha5GwbxbU6dbSkLjOgpbyG0aR5AcjvN4DzfzTTeOU7V9txnmi5qEPBuY= 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 Fri Feb 2 21:00: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: 13543403 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 2C8E1C4828E for ; Fri, 2 Feb 2024 21:00:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 105206B0087; Fri, 2 Feb 2024 16:00:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 065496B008C; Fri, 2 Feb 2024 16:00:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAA706B0087; Fri, 2 Feb 2024 16:00:31 -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 AE4B56B0089 for ; Fri, 2 Feb 2024 16:00:31 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7071040FE4 for ; Fri, 2 Feb 2024 21:00:31 +0000 (UTC) X-FDA: 81748082262.08.4D8D6B2 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf30.hostedemail.com (Postfix) with ESMTP id 884D68001E for ; Fri, 2 Feb 2024 21:00:29 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=uUAHHnSH; 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; 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=1706907629; 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=nFOYeyX6309+a+6sU1bWvvMXfp+fYVHvCwOSsozH0mwyQRDHpVa8o8aXBX39EJV4JZq39g SblsVg3hm48MPQb6s+MswIUEMo5JvMHy+ZJ/pisIyrJt2Ai2Uk76MNv3Bop0rWvXnYmGQt Akc910FjZiKsknP5NXCGHb5UkBxQ0eg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907629; a=rsa-sha256; cv=none; b=NFkTIgesdLvVjgfIYyfcej+DhJoTFjsMj9Z7kfCiMuiPh9MfudL/6ji2/sT20j/RF3KAnm 9ia4HpTYFnnHD1yushmH8XI5Exb9Trs22OhgPyZdoV59Vaf+OeyOdgNMuUpUOXCMtYZy67 3UQEDzfX7afrltX5zupNIrojeI13jsI= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=uUAHHnSH; 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; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907628; bh=NIplNKYnPiSxsRcYozD6/Em7BpOZVdeSTtUJ6fu0NbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUAHHnSH9qyqiPFbxwBtx0+D9xq4cbcOGLgW4N3moWcT7pudTHalnE5g1pd42JIw1 E3TN3gqn3EUKS2dS9BzMQmTDoF+b7/+Qo4cwDn0a2ByIW+HF+RdPmI8Gicr0hw2PC1 rvL4NM2lV7/3fJAgKuzVhmtLD4sYUctQymj+dRbaw03MRctwLcGdqytl4bAfkLRnmT 4zEaxXtJqlO+Duz6P4JaEGwtf4+/NJP0OjTM0KP4jY3eHJU+9XKKJK07j50wLLNsZI 5soy4VlB1L6a0Mfw3iWgCtncLHEZ7CxNE1IQAbBR3d217g1gnazmhpUoUCZ9XrHKcd Qr321w76PHugg== 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 4TRSph2fcvzX4S; Fri, 2 Feb 2024 16:00:28 -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: [RFC PATCH v4 04/12] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure Date: Fri, 2 Feb 2024 16:00:11 -0500 Message-Id: <20240202210019.88022-5-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 884D68001E X-Rspam-User: X-Stat-Signature: xaqfa9ejf17t4kycfhatwnjexw87fkbc X-Rspamd-Server: rspam03 X-HE-Tag: 1706907629-734742 X-HE-Meta: U2FsdGVkX19549NP6NnQwNJeXSq8RuByd5avBHObumBz85zq2BBFwSQZvGgL7+HtX4ad6TIO0Mc7vGODo9OpDzq/dxEA7UoP8QnUba+9xMdnkfCRFvIjL/gjTUnfctoldBmd8lX/oI4MVtspWzNt4C9cEJ7A9oMPp+6cXzw6BhxzFmvhKrAZv3eIaUCy/oirdhiXFWxazBDUSYEvhqgUQ4wBstdsLVsW/NoyZy2VsDcvtonBPX9WUq4qyJqsOSFaJVtXoujWHa3lo59lxTQVHNoRjT6ZteiFWNTdgZHSO3rRByEpcnFZjIlrFP9pR9l7s1PG4fTMjE1JMO3SgmyVctrJTvrtaYE9O+HV1yFKEaXX83jKnvoPW71H2RPk/I7c8uaEvS62X5vXgBnkhI4izemfOqYEYvqDt4sSNCAFDM+NsRyVyT7mY5v7vyYhTjy2nTm603WsVmrk1vj7+e2wM8ChtYDFiVGo9T/kiqqeFDbi/JmAJTJHyqaRAyQqL9NAACahtphsJ32e+47D4aRlFcTFj3PU2nf7BJKAKuyIPSWjAFkBg0LvAT50yF0G0R+DLdHIxJPo0qKuuV4+46+hmZKGOfxOfaCLngzZF/V2kPZGRWgMNEMDloUcw42UKMzRJOTfRe/LNKNUdI6fMMPmqtiVrJOXIhcnApjIf9p9KFhT6ddHDBl0Kjl3Vk3nIhvCcmsfYishdZFgAVjrKCbAayx3RkIKj7j8h+Cb2Imj0+Yyr4fxPwztXUapqC1ZW5aOQko3aXktR1e5FxjMYaRC7vZoG8YCSwdaiK0OR22jker7ukZ/E9SUdhTJ7QtH6YuQIHacUNrFlmxHByCNSAkrl1nwaiMH/GI/kKd+BOU1h0YC3wLC6Yy8vubGhttqRft5hckka+se23H3coTaoXyJH4fhIkXr3xLi61b9McDZlIgEBLs8O+KoVDmrs8KFzDqsRYK2Ky1ty7HEVZGTw08 yanQRIeB fUvJoYFwfDplm7/+DBHGSCJkZAH/w2RKB/zxtl9qHwX2L7X7QnL/Cn4xxRuaFKQdwFgntnx2X/3YENB0cPcQMFjz0+iKq2G+rLwJE+CTQwdztu1IzseuzBZSbP3MuYh/ktSqNkVVimwt4UKbSKvt05aZcrm6EwWkGIexmNI1FU1C9jLClMSNTfHuAvRviv8ldCO9xOMzajTwt+H7C9hLjpChn3gZUYb1vFPVk9uvrRY8hoe0pxrqEL8NSuni0seLdlX0R4SliJxo9M+hVxR0R0W2EfR36l1hnBhMp6KMdwycwsw03BuHbI86E2NaxAK5RZBvdmsJFsv7GJNkg4cpEopMYrwRFnm2qKu/OJYv+0c1C1gTvcHvYnEhpi3QgTxp4UxUvTOZGl9msl71H/ybQ9x2lruEokM5bGF/tXh3JeDLLeeGHprqfGr9X5/mqor53KQ2/gxFuwRByRgR+cOmlgxB2GzUJ8nR+M0UJvl90lS41Bq0wZiS725JZs/aucLdts2XbnZMjKc9xDbj+fG/2iOXZE9/Iecrdxz4j4T+pJ2BvUekFgvyH1pJRGLRW8c4TVjh2Udj+uccOJy0Sx1yKt4SV3R+3MEmgNgRgMfjzFVYnohnm+Yr+3CjSdo12iThkrx1xBQMpS/4MwnM= 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 Fri Feb 2 21:00: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: 13543404 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 0A797C4828E for ; Fri, 2 Feb 2024 21:00:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 857F26B008C; Fri, 2 Feb 2024 16:00:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 723666B0095; Fri, 2 Feb 2024 16:00:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 521396B0092; Fri, 2 Feb 2024 16:00:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 42D926B0089 for ; Fri, 2 Feb 2024 16:00:32 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0641D1C0E1B for ; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) X-FDA: 81748082304.22.B54DA99 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf01.hostedemail.com (Postfix) with ESMTP id 6393E40014 for ; Fri, 2 Feb 2024 21:00:30 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=fQOdZGB8; 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; 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=1706907630; 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=k31p5HstnMvFsrm+WlRdRd/CqCUaynTcqf8OiOB+8hgDL043Q0HCB1vtmy9nJ+hOP7xX8t 10NJhQVX40nVe0qdsD1IYe9IKVFJCo+iXAwawksILRwMET1Ufb3z46PjKX4e2N0HBw63jL EUXCqOLp0FoD0Ujcb1BQThe803jJxJA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907630; a=rsa-sha256; cv=none; b=oX2ii3VmItik5QtJILxvalB4pKHfBcT9GA0Z5di76ww4ygw3hvj+G1xNwHAE1bsWLN88ZD jN41CTSjaPm5U82L3NSd7SgZDY5GUSMeZT5/1Ebyl9mhrDPLJtf7kSI63JLdwjsBUvlt8G ObWtTC2Et/D912NNl7XL+t1D00WDTVk= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=fQOdZGB8; 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; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907629; bh=6kaHeiBxh7tXa+wyC1kCcD7MhkDErN5w3UH4NjBdGts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQOdZGB8ZoM+ot4BpfHpDhS3UZ/Xl9kL6L2cCK/HSOO89KLHleVlUen3Hvy7uouoA jkSg4Ou1+kepWAwhWgSZKXNNm6LCEyBCdPkykABCJgThUTXtmOtFcZ6bxqN2ifCI+o 96d3GrsSllptt4Mc0jotzKMhB/znC1tQydRK48oH5ngXTQVmKOtZrOhOG0WfGwKx6w kfMewMuk+6MGuzHxK4hWcgzNa+KJTaQFp4kakLGUOhyCRsSciU6S8CX33ScaDEGVFa qlecryD5H6JRb2MG0sirVt1fMHpExeBDP5sB+exAwyLtxDtvgAdLPLFw2aSkquU6rq T/tHs8uC3lE8Q== 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 4TRSph5pS4zX4T; Fri, 2 Feb 2024 16:00:28 -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: [RFC PATCH v4 05/12] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Fri, 2 Feb 2024 16:00:12 -0500 Message-Id: <20240202210019.88022-6-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6393E40014 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ht1a7xpj9wu9rhgxeohu6e4d163iisea X-HE-Tag: 1706907630-515689 X-HE-Meta: U2FsdGVkX19B/3xAeIHoMw0XO1/STqTNgpzYe/eVDpZlcN8qnyHKNcQty0tNoIohSBWOH1O/ClmF9MCx65BWg9sgBEsAL+AhBwVZbcq8p1JRFHLk/VzjkNZRo0wP7k4a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3NNPPMeW+30t4bHIxKJXQnOKFyLrVgoGwSMXFtI3otXuvR1Dyl9MMyAN1BojaEQUFH/ZS3bZY0lBXRA95LDMThpoZfUqRwLVKwh2ITluMA9bsQ2J/F1h0WBgu1NqUsIvOjdSQXsJx8ZbOP/uCq/BuP7kEXztNaeakzVZDAwgnO1gAn9gczF37wFqvC3Oic5/nnPD7Mgzgdaxn9UyYaVCppYOpxtngm39yckhf5VP2mHUcXshHeSahl59DPtququ9rJhFA4S2q2pouh0X2TZK84iDYCuF2g4G3A7u6ctHu56rApKQ07qzMf4iNnLjIqDsv6RlUo6AjaxmlzHJUgflk05S6pX0JQ0QOyVtE770K4HaNKyBcu81eI327LdJ89BooQSWg//DTgfqsfapX9JzsujxsCWD0rRpFbGikFODu0RMrESDJqI0FSPxH5uk= 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 Fri Feb 2 21:00: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: 13543405 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 52406C4828E for ; Fri, 2 Feb 2024 21:00:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9DB36B0098; Fri, 2 Feb 2024 16:00:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BE05D6B0095; Fri, 2 Feb 2024 16:00:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8584B6B0096; Fri, 2 Feb 2024 16:00:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 603C96B0089 for ; Fri, 2 Feb 2024 16:00:32 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3D8A18032F for ; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) X-FDA: 81748082304.19.C9776D8 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf20.hostedemail.com (Postfix) with ESMTP id 7C3D31C002F for ; Fri, 2 Feb 2024 21:00:30 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=MHwLCxMM; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf20.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=1706907630; 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=IdQwAgQnppzTRtFptc0yNrc4RPMR6T1EaluvNBcFSQZjPNjM/8Ludz/r+7L2m6jUif95MH 04eazafhF6s2bdA8ZuELgPU0NDGjSFhhfZJXf+cnwymsrS/fW5e07ZDE7Wv7D1qFdxoJdH Mo9amGVsG/DSHw4EQAsq5sPFs0QHUrs= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=MHwLCxMM; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf20.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=1706907630; a=rsa-sha256; cv=none; b=KU98a6Y7Rw8KILDqimkcpSWXbc5a8pT9y/a1BjBip9rosxEXP/Qvd7eTdxMNEVmhAD99Dj EfmcWyBU5S424+foKYjb86Fty6qI/Q7gTs6p0awTYQRUDMo3R67x/dT0H/vIEeX/PS9B5T dvE9xobgLiV9CR9kdb5++EFMyC0W3g4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907629; bh=hDhYMA3F+4l5mMIlcEOrH62nfylV2E9jEwkIfVNtigI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MHwLCxMMJ8oX6+bHEOyVn0lkZWWp3rdA/3Ni7ikq4m3u/+zRvC1YBE6wqxLL7ME+n bgtUOSoSwrkc53a8AMpqI8r1roW5ed7yLgGbUksKRENhkgdc0fwks9v/6nR8TTMRY6 +0nAINngg+wnnGf/N2eZwv+LGmczJE5nl1OEURUOSjYrBV3Ql9BFVUT9r7x6rBUKiR OS4hhk0KIM4MvPNbRVvDfCHuI/kNx4MaTpchFxgSzS7luhDBCjsF2qKuj4PU9PWXMv olV2aSH37fJ9i07BukbKYDwL9bHUbH1JJggkbDvLLLQ04RCIH7ZHMou+lQfNNPnT6u 8aHu31qfGDDKg== 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 4TRSpj1nT8zXBx; Fri, 2 Feb 2024 16:00:29 -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: [RFC PATCH v4 06/12] dax: Check for data cache aliasing at runtime Date: Fri, 2 Feb 2024 16:00:13 -0500 Message-Id: <20240202210019.88022-7-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 5yfapo4ne733837n8z9frj8e6u3c5cd1 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7C3D31C002F X-HE-Tag: 1706907630-470320 X-HE-Meta: U2FsdGVkX1/FR+ikz7OuqrTNxyJPQhC1NRaO2SSwMG96i8vCaDWoFisfbCOwBq5eK+gD5IWL/fp49v3xgH0NvHASagDIsf5TKvQ6VD2YroreAzcgnvSZTRYvzbzBQ4PRDoNaVmitEDH7TtDC8vqNHmKyNZVZgGn62Q/GOarIQXtfSg4YunNNDzY26pfsAjs0UTfhzGEoKhwvxG/0NWtCtwQ+8bYXqBEs0iuTZ+kG60QDrVcb9JNPzuqYMklACgU1obYySDxk4Fvg2jl9BS59YS86q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pOFQygBtEVQPk1KfeUovUhlRYy/IidMHcy5a7Gl/b+JrpRRQdBijTmhp1aGFAQ7CCeybG900kl2re+NBsFzTge1AUzZWmEx56XyaAL0xnjailUMEeEIueFh4wvuc+9IoKbqgQKZq0S3WkX+91uHGerSn/s2U4LJOOVkpQ29bcM8+iCxZaxJOP/CyeFV9T6mVuLLkOB8Rx6 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 --- 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 Fri Feb 2 21:00:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13543406 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 86751C4828E for ; Fri, 2 Feb 2024 21:00:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 28C076B0095; Fri, 2 Feb 2024 16:00:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EC336B0092; Fri, 2 Feb 2024 16:00:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9E4F6B0092; Fri, 2 Feb 2024 16:00:32 -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 B19546B0089 for ; Fri, 2 Feb 2024 16:00:32 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8CBB980281 for ; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) X-FDA: 81748082304.18.2D165B5 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf15.hostedemail.com (Postfix) with ESMTP id C33E4A0011 for ; Fri, 2 Feb 2024 21:00:30 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=oLJLGT98; spf=pass (imf15.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=1706907630; 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=Gf2YWPi/n/OyW75/W3z0Y0YfUkYanYA4Nf8Widv2AvbvrPdsnuH5WKKqZr/Z1FkU7MBkSB lsyQS3CUxJTCCayoUhg20l34gxAJ/WxlkwW+P//27MoSC6SqzCtvaa5rmMB+XqH60uCcba 4k/HOMc5Ai4+HfU+wgrq5Ag14XlHRWo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907630; a=rsa-sha256; cv=none; b=lPs0xKz5n30rSyFFCYF9ASf5WVxUVErhs1bfway+2bXTG6sCKOZn8DeNSJ0ZzKDiyuoFGZ khiTI5eRqKXt2Je6iRl5gwbh6Jyl8BhM/UV6MzjERZi2LT4hCB+AfKwlE1npODEhvZ21eU gq3AyFTUv7nWPsBVDZtCelopimJClXk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=oLJLGT98; spf=pass (imf15.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=1706907629; bh=yhcYPD4d/Sk8n4rn3QR3NdUtoL+Ae4/2ZbOPQLO15Yg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oLJLGT98D+lefR1KLWOWJYjFCixUI/BR29qaR8DetoIJoFAnfcPx6gT7zQ4YYlbvK iepjTNUeSero6tm16G4R5obJYNlSwMK3/ZshDWqHB6q3Xdl6V9agtOCw5/pBb2jM7k umEQ8qeEOdabTQrZwl7e8BIlnIZxYVFEddP4Y50xzbQqO5BuCFptfcdRlcQjpjmYtn EwDOoJUGo3us5812NTgAfQig7Gksfuu4+IYhudmuVBF79NdwsS9ADA1IR+lkav85pl 2lMLw0DWryRxFDzT6q9i6a1rd1RosB4Y7cQYlNfW1ivkq0TG/GdZTlCGmRM4Il1b4W 0n9EWcK6xTxWQ== 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 4TRSpj4YHqzX4V; Fri, 2 Feb 2024 16:00:29 -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: [RFC PATCH v4 07/12] Introduce cpu_dcache_is_aliasing() across all architectures Date: Fri, 2 Feb 2024 16:00:14 -0500 Message-Id: <20240202210019.88022-8-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: C33E4A0011 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: y99mdwc7p935abhq8bm9k5kfawa9yu77 X-HE-Tag: 1706907630-149397 X-HE-Meta: U2FsdGVkX18a0oqQUlQLFcSd4csn6O+Yj2qaL93cIWPAGlFYxE3Y5TNpH2c/tMIu2+pMzS08A3IBk0IgDK6ZJ4PKa7GCVsjZU4I/Sv2AJUVr25hfgOo+KUZT3ULoG68gAE8rbq1H+jhvKVUhFvTqXalzdfpPM2aYawy29w5wTWc1XpF6iKCppogLBa4/YGHw8kwOuyuoU5x11C2EV4Y/BurDlyK5m/d7gBxF4Py8OMy5llhTOgtaktoyOe7J7i8nzPffTiydZ7Pjx4CgloPy8/BGEpdE6YZqkLfHppOYaVbGdlfK0bzuje1Xf8i1FNXbg69pijRdo1sztsPJDEUs/5URCusaQbpO9FPe+vgw4G7ktndpHwHAfX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iOUJjl9Kr6ppfNsgRmWFogN4E/BtWDFO0BoflQChx4pMSR2sssCzyAVldHecQWqkrKEM3UfSNT9SM+fmt5xGR+4ZOAQIkc8YHfns6Y4+u8Z7wUaXn5G2kh5qNLHB+FOgHJItZzUhwbCxC1U5NYiFJOadMJgbgrFkNQKIymYzQZYK43bYx1Nx78BBcr+trYGztBj7/mOkymXFbEau9IZ5ww695o9qhgqVKjWC3do+Ev/cbjFTBZtYCwPWtpEHL06zR9g02l88yQ9+c= 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 Fri Feb 2 21:00:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13543407 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 1DA6FC4828E for ; Fri, 2 Feb 2024 21:00:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B7E06B0092; Fri, 2 Feb 2024 16:00:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 423066B009B; Fri, 2 Feb 2024 16:00:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19F806B009A; Fri, 2 Feb 2024 16:00:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id CA7856B0099 for ; Fri, 2 Feb 2024 16:00:32 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9B88E14078A for ; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) X-FDA: 81748082304.17.35370EA Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf08.hostedemail.com (Postfix) with ESMTP id F0E5E160002 for ; Fri, 2 Feb 2024 21:00:30 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=pmLoboe0; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf08.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=1706907631; 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=omdXkN+ANYU+fc16emvu0An8A+RQ7/YOypFMhoS2WgDNfmzez+ZMH0JuaMacbMK78SrFfF blY7gvJSNuYKi2J7kGJ4cQlrv0NYT31OAtWC4JkiWCsN4tx2uph/XaMHnKGQKfOIgRR0W3 DilfsaEJgpa/+tNtmBTFJWFXPz/zUBM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=pmLoboe0; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf08.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=1706907631; a=rsa-sha256; cv=none; b=qEHJokIZP2LEwqpsT2x2j2dA5XQmhvkc1ANfyJUCVBkbRPJktonqsadmRY+7+LTvXPGSCv BiIlH9zkkpcjEWvfKLZl5x6E96wl2jbDbpT9QD5ioJyyiDHjsplRn8ENs9tSVui0WoCVGn ytTZZ53Xht7zFTAgXJQUDGgalu2S0nw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907630; bh=MgteUY0CjaNYCNu4ZJjdjfbOYQwaLS6hDEa6C2rXhOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pmLoboe0biQmKhxDQSLFLxe9fj2PBsN9j380mMLjyT2JWK4NKO5DYgC1oKms1hE2X mfyhAqyK/4sWjvu2qrc9U3QSqaqdyPHsaoH3DXLzgSTf2MpcJhENZ7zYoOFFmnOuBS gq8dm7ShaBHLybdKCaEnCossjL+YsNN4tFqYabm5/ufcyshuoiCyl85YvJNrai7hcD g/MvYLbhc2C8SRDi3vXOv1e/GsbbwcSRytwt5wh6vd4lIvjdXNaK3Rv4NQtXV9mGyQ qRZcVkbjwe9zctNTJvb9TxZ3hp1mRdRztkjvgnCT6YZP+6xeRdYi1Vjd3i0T8hyz6s 5wJOddiVYFkFw== 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 4TRSpk0JNRzX4W; Fri, 2 Feb 2024 16:00:30 -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: [RFC PATCH v4 08/12] dax: Fix incorrect list of data cache aliasing architectures Date: Fri, 2 Feb 2024 16:00:15 -0500 Message-Id: <20240202210019.88022-9-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: F0E5E160002 X-Stat-Signature: 3o5b61mgyieyog5npe6dxhk5ja4ir9ud X-Rspam-User: X-HE-Tag: 1706907630-97069 X-HE-Meta: U2FsdGVkX1+xet3PxI4f3kb7eAHRPeX2h+lhS2S//5YDErLyozEtWOZy0vIWlh2UnWl0cO//xoKutQblNKwqzyOeImBi/2cjwQ5EaOA1QVXW3LnnAFMH1Sb2BjO26TfdCi/vIf35ajcs5bYJfVMLFjrzDbLsPeRfQy/EKvG1sFNkimfToIyjGCtr7HhX/umqTzWuLCXVdaPVmBfzxdJRICtRmgbHkO0Jo7jTvfCwsjuojVC5+olCxjwdNDd0CSDYg21usojdRnAKC2vV76yu9i1RXNUQbSMJ6xhxcBPi6u9Sz+xTLCV58gm6ZWxurAOK3nLT2iqcr5CYwRnjRgcnKp9GpV/bqW1zM0ASKMvk5FpCwtuKAFxB/Xf8Ev1TeUCncSmL9pnHutfR+cNHEbfr7H/tN9WMfs8XC+m5ImhPtH3oHu2iKOvnRxOzfOP7q2ao4a29Z/7JQgzMESVE8592HrwG250TEPz1bV/Dbh9BaF/Hhi3R75Vc/mxxgyd4lbirdlLjCL+zePLWNr4T6l1MyPDXvuHnZT8J2dq3m7dR8T5+YP/MZ58gSHHltKwXrahILMluJ6CE/PmF19J0Ci485TcgNeRXI+O6FWGLDLhxhJWAajbNyfHzoeH4l08OT57AYmbY2z0pOAFCHztI4odg2PsjV1Wj8cxeZxiYY0mYUV6CvPU7YVVNJ8qpNm20xSql1tnxQfKVeNTtPL8o4fDXiM0Gy/ihnW8F27Ni/8X2EW/eLly5BGDjUG/Nx2sgN36wtEGHASfRRiulaH7749D5POZsjVOhV66krdTOFKFsprrwy0GMxxz7l6mX0a1yUM+Duk3D3DU81MdSxJY5mxqNooQgjZC2f3Ofi6lU2udpKsch804Q0Jcb9QS73mWFHhS51RZPHKTTkDnL/DZd8HsXCFBipWqc7wlA1cPgxUVy7AzmenUmQzp5/e/27icw/fmI2Q6IeJ7Ksgehplp9mjF VKUu7Q97 ctLsdfBqdVTQ6c0mF2hRQQBh62RP+Asjg615psZSY7p1HrSb3I81DcU+XoUk15e3fBEQOxLVAFfVtHY7oJkOGE9PLiy4f5qWAuLmtNEKYXvnll1dCJIxyOvQDaMpUHUqOiJaj1lAF4KYJq1f5Jplq1HKDeDzlbwE3IQWWEcMPQNquzNa9dpByU3lUMAhbkkPvarl7Rsl7u1VbNLuz8EvqURa/sL+K+W/06FpI94o7IUa4XrAoWcZHJj9PVQr7S6eHuMvGtipYuhWoKloQDIKk9fbOYOW6zGyMjVEfbM8j0f9f5JGaRM/D2YE7pSn6bYdTxWX9tOTdzm2piwapu8vapWegddyJ0lruKFJ/j4V7Tk1zwhJNlWLeVeo3U9k+FiD7Jtc24zV+D5IMN75ZM0ix34RfwyEHrBqN5ZFHgOHBl3yHLLp2sqJgERD0EhAoTzIA2nj1eqhSseyzPeAxXNihiJYOLnS168EyAiaHuyDrHi3Y+DF3sztO1NT1gzahg+zGZDlRYMLygTHUfer7B4v+egar2Scvzq9gAACTaq8cf2Mih8JMbE7VUu/f+agyNjxPx+4k 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 --- 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 Fri Feb 2 21:00:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13543408 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 635D4C4828E for ; Fri, 2 Feb 2024 21:00:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 904416B0096; Fri, 2 Feb 2024 16:00:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 883A36B009A; Fri, 2 Feb 2024 16:00:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FB846B0099; Fri, 2 Feb 2024 16:00:33 -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 2B7C06B0096 for ; Fri, 2 Feb 2024 16:00:33 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 07DE240FD7 for ; Fri, 2 Feb 2024 21:00:33 +0000 (UTC) X-FDA: 81748082346.06.851F411 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf06.hostedemail.com (Postfix) with ESMTP id 56025180023 for ; Fri, 2 Feb 2024 21:00:31 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=t638+rYb; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf06.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=1706907631; 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=YzuKV3m2h3n+17EnLsRvX9ZiqSDePLhGi2yQ7ylRFmYx7SwX4FHklKupCoTcthhL0di8Fw 1uaOEfuF6vwwDLSrLT3dTHJXu6bDEdrl9RdzP7iWFtHNFyQBQaSVO0jOww3KpVX7WS9BwT zr5i2jYKDf7CbqWk9ITjg5rzV+7Y+sw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=t638+rYb; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf06.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=1706907631; a=rsa-sha256; cv=none; b=BHmyiBrTRuXIpkshfzDnWFWolOghUPkWhmmN1nFspWjxLFDQ/Q7QsV5qratC19qoAjdH4v lGnx9nB/qg2OajQ/U4W4WiFCTmuYel4Jgh5J5DGWSdHl7BhleU4jaFie/V4K42jmeUwZZC Ys5lVjsQZ3nOplzgUp4tk4tm/GWmR30= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907630; bh=Iy1T66BEIuPj6bTS95Nd9D5h8aE2OAfCM3Sw4sgOgjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t638+rYbOFyXGgFVCvFYOjUcEKa8934Yh63zuA8Ip6CU+8nNAmiILkFgP8nw6XNPm ex5CrBXXgswNdV/g8sBEiCvZYGg4PT9Lwyg/6bqVeoJd9Y6lUnnrRi5CJEebiyiNGc BE2bJEKg6gCvFyhHXyT6qlw2C/xtKJ4ydBnC7IKca5iBk50a9s7RMnjLexCDeQIzct afJMtBUYLz+HyBuALYfSgAhiSzzmkVG4JGiBZH0W9xaSZtl2ODjuUL+l+9YbPksYZ/ L/+hs3IKD1BF2vqbCEzbqvXahtVAWhb4urtvIiA9DqevrCh76z9aa+kAAqoSPkK7Gj QCrn07lWmahCA== 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 4TRSpk37PFzX4X; Fri, 2 Feb 2024 16:00:30 -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: [RFC PATCH v4 09/12] nvdimm/pmem: Cleanup alloc_dax() error handling Date: Fri, 2 Feb 2024 16:00:16 -0500 Message-Id: <20240202210019.88022-10-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 56025180023 X-Stat-Signature: 9m7i3s3gtxhradtz5r7xnwyfpw48of9j X-HE-Tag: 1706907631-436835 X-HE-Meta: U2FsdGVkX18ZWjK7F/0+M7DdxyK1FCFqKtFWgF/nNSygdNj+i+HZzKzCz2jalJdlHKdgiYb6BmPEbifdvlmERO6TiyncoKG1ZCBECXXeUZDc6y7Wi0DBci4iZhM8iTqe9Is3BejOa4fdAc8wQ2gmz8jGuKXR8jT0wwOQ2AMBzoSkTyMkfbBo9If0cJC+efpEXxqdC4loMYmJsfjqNEII5zXBLdHHgrI0i+PbVi6TBeMfhlHWzZgiU9V3Dw6D+YL/iaVMCFhb9/vtIoIcaLfT059bi6iX0vZ1+I+mrHuHKUmsC7ipVTFO+KTegVX8b8WiCqUMjQYMZB8TYIymKDSqypM0xfqyE707trixqf0cE0CXoB+svTr60X1BPr3NxQUM56/t9X1uNVEuph9Efp898iH7Q2uzOgb9pzRpdmf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V0Bt/HwmndYuSx/3+/1fAbjV3ljz6j7vpM2m9HPw3RDvdCnkbtY5lyFLXdZeffY9c3Lg2n+7NvQJuKefIW72fFNkDkKHsQ0WA58I8Jj4cmahrHBR5zeeWB/kDNxQHRN+/g= 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 Fri Feb 2 21:00:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13543409 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 A2174C4828F for ; Fri, 2 Feb 2024 21:00:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 216CA6B0099; Fri, 2 Feb 2024 16:00:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 19F786B009A; Fri, 2 Feb 2024 16:00:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 017786B009B; Fri, 2 Feb 2024 16:00:33 -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 E34756B0099 for ; Fri, 2 Feb 2024 16:00:33 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8C2571A1056 for ; Fri, 2 Feb 2024 21:00:33 +0000 (UTC) X-FDA: 81748082346.27.E8D8A74 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf05.hostedemail.com (Postfix) with ESMTP id 036CC10002C for ; Fri, 2 Feb 2024 21:00:31 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=stqve+V0; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf05.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=1706907632; 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=yeCYcTi3CZzecsXO+ZUZHmJb0+3NTtXbmseMqXV2eVOjR35ycyXQh3icIFkX+5ze0nTb37 RnlwE2UNQZmJOYcdaElJgJ5w5J/o6S1xq+yND4r/lbwuPux/CJBh5r1p7JI+eFJncp2cUy r/liZmGUd6/wZP+ASE9HwXsRi4Qqq2s= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=stqve+V0; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf05.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=1706907632; a=rsa-sha256; cv=none; b=7D9sgUogRjIVGXVF9XAAXaQbZLUlOtIQWg1AGlkTD8eVxXuR3ETDq2ilDJD/AbdC7SDvBS QtuXvkHJ41n4ANvgm3XXYyNEBWlvZJsdqPn5oavQyw4lTjnls/IboN6alZ9nGnraMpw+uS D3GKAmrsf2p9QNM0F1zSTIKNwJiidk4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907631; bh=3qwtk0TzM3yqkpdWTkMn8G1D7Yvm6JJDP82nQNcfpzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=stqve+V0iP+i7A8cWyEdeR/J0+TFtioEAeqXubDQfNrggDawyuTqMyi7DlnWDbJPW iDOy+p1MQzxotedzOUguk4h94qZrEA0AN7mjmuzZ7X9J6dE3YIgS9yNly8YeiJOzGM aE02qMnnDQ2TWTEIqq0WhcRJylZzNF3EBqhM9xwgiCTZuXtmJxPxi/59mJrN+FJJS9 iMUPk/3CUQifwg8kFZnYAe8PayUfUzpS9yBrCAjw9+zgkOAWJzl1Hsfmh4xylcg2sf DyIb2UVO9CL+zPup7gMxuA3MqBvmsHTIUEuxKr01Euu+/TTDdIo2T9pudSkFGCgQor 3SRQF2RTqGK/Q== 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 4TRSpk6BX1zXBy; Fri, 2 Feb 2024 16:00:30 -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: [RFC PATCH v4 10/12] dm: Cleanup alloc_dax() error handling Date: Fri, 2 Feb 2024 16:00:17 -0500 Message-Id: <20240202210019.88022-11-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 6hpbjdzritaod1p4srkft163ana3cfx3 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 036CC10002C X-HE-Tag: 1706907631-184677 X-HE-Meta: U2FsdGVkX1+5ba2XUK+8etSwKESHy0+4ir6nildspgSsH2a3n4udNaP8XAeFixs/jb8lbEQ6DrwJRvXgmBR8cPLoig53FpQ6ziaFuxe97nhQSEoBt2kJw7VgoXWVKpfwuWb6s/PV/FzOVpfK/Wp3zv1ehnKrG2RFwaAXNcyIsIpWOwXM6P9aSrHKesKQmljT0uen+PQWKzOKXFPBnnWDhA5M7COMG+i3+aVvfjvwbRf/l34EHeRUOKvqi6b1irTndZhG8MPPGUx15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fBeKAR+TGP0dkafBecuvXJGEUyE6DpElncKFoPsnmzErbZMDDiHOWoHInskZetO/6pHnsX2VKGbVrDxyk2BjqXEi2jSYKjjnm4WADfmVKVz2P2Af7SEvz1t5blJDdSRGzvEmtp/58qqGDXAU5nM6rTKB5bpdsnhqZ/5f6mPI/NZv4cF+XRSKT/0mnmHPKc4GE+yZUjt5cBJAk5DWoBEswqwWy3UOrXIMJtJMTDPDOFg9PZzOLVeaBxi1yy0nb8R+UXqe06EW+896tiXtzHS1AG4Lo= 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 Fri Feb 2 21:00:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13543411 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 3CCD2C4828F for ; Fri, 2 Feb 2024 21:01:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 380236B009B; Fri, 2 Feb 2024 16:00:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D7BD6B009C; Fri, 2 Feb 2024 16:00:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12C096B009D; Fri, 2 Feb 2024 16:00:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EE9D46B009B for ; Fri, 2 Feb 2024 16:00:34 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E3E6BA1B88 for ; Fri, 2 Feb 2024 21:00:33 +0000 (UTC) X-FDA: 81748082346.26.5BDA6FE Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf22.hostedemail.com (Postfix) with ESMTP id 38EB6C0028 for ; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=EUrM2Ixo; 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; 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=1706907632; 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=FkacFnYGA3+ra5LQNNGJLq3d3pzpIYpg1cWexiBfHVmN+wppw/FiidUxMWGSDf18QstV0p WP3evseHWdLyw9NikvVF4bY9UkeVNcKZU9cttS3tjxR6cJxbkh4yvU5vza42BI88y4GnqD KZdshh1SmmXrkneFwJoRISl45K6gpLI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907632; a=rsa-sha256; cv=none; b=dufTbbw6MDJLrpPpe0Jgb7jQydDH5JTOtgVkV+3Y0LqEcoYlS9VFr1moIsz60R5cqbEtoO IXiWDjvfqIv4KR660uK6ys0szcQgj9Cj3eCw/jxo3OIQQeU1NqjwLeHzS4lu8DL+jy7y88 FQeQvkiJtu52FH3oUFXk8cvQ9VWVQ9c= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=EUrM2Ixo; 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; dmarc=pass (policy=none) header.from=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706907631; bh=oenQ3E1qB1jTPZO/gOZI9CMarWIZCEOT7s/3o23TNGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EUrM2IxoVXxxnRIToHQMZOhPk9gxQubStmbtthZYDw31vk3Gq1zHoqE9Ipozu0q5V 1hYJcL+h/XhwcyH8vbLeRzSvrpkAvpK+j6vGZ5gKg3jf+e6YcbhDmWRqfsRUydwl6N u3nI3iwadMJcDptIbtAz09OhK6R4EUWG/IkwBtKQK0NmTM9ACIBQkgSXMZNP0oQH/P 3i3Z0mkQs5yN7of8m/Kvi9WJ8sjL58PdgznpGnfRt+ZtXTAMiSixlS3z7EcPPk8nhL Jgk3wmuH6ir19MMCyUpNqZz/UFitX1O12pMxzZaD4j4jy7oAuJ9XuL7M5LU9pBLcEf rJ90dLYux73mA== 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 4TRSpl28gvzX2M; Fri, 2 Feb 2024 16:00:31 -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: [RFC PATCH v4 11/12] dcssblk: Cleanup alloc_dax() error handling Date: Fri, 2 Feb 2024 16:00:18 -0500 Message-Id: <20240202210019.88022-12-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Stat-Signature: htm6cudwym133zys4xgdeznrsu7k8x4f X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 38EB6C0028 X-Rspam-User: X-HE-Tag: 1706907632-375150 X-HE-Meta: U2FsdGVkX18VLDFmv3LykJPBI/B389xoCRdodTuqdHvwG1nfe04LUWXQUc7zjdmn0dG6tQNkXtHASKATeYs8jLR3xGg8MT3dlYpPwUD/7LccRH08YYusRXNWH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G+wmMNLJ/sMDUXT9RZQcJo3XXPYcGK3jzk0KZPuv4DmmUlGD0Fy2yUfvntJ7/vTzB6aipR1HQwd6ieEq2d0rTLWEleHK2Mb6eRjYP/9bLgBoS2zH0lpdg+5MhpKTXeEsaND/x623/CCaOjT+ThKovP/PubInT2BAlOEg7uKyNgm+FWlq48z9dtUq6kkyNmkCBb9gerwxaJ0QoWMJu+QqCtnnXQaIZn8qpY8cE/rZDPiALhRS9RsPMtYpLxfCAHgQAXHKKvq8bfKHcnoUs5H5iJ5afMIdWd9ohAgU7XIXPO2ZGioOVy1GNeloS+i5QHrDDu8SvRyYcBrwLP9QI+rLhJzaKRd3fOo1n16UhglN3R5YxIGhPxDmp57r9ulz1l1mLXUgN9wE+Gka0gpKJq0wUaZPm44fiVMjOEg8NgF2sxTPc5rVRxQEz3HvlU= 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 Fri Feb 2 21:00:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13543410 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 0F34FC4828F for ; Fri, 2 Feb 2024 21:01:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B92C36B009A; Fri, 2 Feb 2024 16:00:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AED0C6B009B; Fri, 2 Feb 2024 16:00:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DB856B009C; Fri, 2 Feb 2024 16:00:34 -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 83A716B009A for ; Fri, 2 Feb 2024 16:00:34 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 561B9120F4C for ; Fri, 2 Feb 2024 21:00:34 +0000 (UTC) X-FDA: 81748082388.18.51FFAC8 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf18.hostedemail.com (Postfix) with ESMTP id AF0C41C0025 for ; Fri, 2 Feb 2024 21:00:32 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=lqFXIBkP; spf=pass (imf18.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=1706907632; 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=53C5W74CpINhAFJmCZar0nsJgO6KdUVYbwdREhDGPtSIJu/t/jtv4EgeCNVw0NyLR1ogN0 koTPIfoRxZtxcl5fxCwXmpcj1QN4Ej7CFVBFr5XSfg2ByHr/OvAxY2vqKnh8CNsp0/cvsN 1IRY3V8isRXJtC2UZ2nCIuaeXoQnqXs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706907632; a=rsa-sha256; cv=none; b=o+bTA2o0+yIxwNL4qQaGN6nXiS1mQTC3YGYukcpyYYsE6RoD5p6a55hTfDsKJmVDWvdWSm TYkTVFVY3VgtdE4tNgRlZI5iVtD4nqiJ9Xds26P+wfyBR7rvUzlczliYqwQXfYd/uaABoq HjnSooQ6bRftYT6D+NUvMwBqU+UUK2M= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=lqFXIBkP; spf=pass (imf18.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=1706907632; bh=umcqlnyoni1L+YV9DQVqbsmdwpCSWY7IqX3VvZk7A10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lqFXIBkPDeZLU45mjUmnm0q3K473FzSvhK0mnrXvhigDtwWMPffN/nvDG+HjmLhap XrVKFSp8liCgJWM5Eg0tCRrj2fhEw2prPWKm1ioqpCgipg1igi1SaDbnkeKOm6XGCA 5TNwnhRSJ8qxzVcg2hGw3+/ggGMs07Oerum0TU9KO61RsOC0dkF05xsu1dTLTBbqhh N/kWbUj5cfkrNfMI6UKWA0tHM87k+2eksxppdkVd2mkAhQ8jBpJZZiG1ADrMpVpvQM jagnOvFu4AVyj7SZMGqU2NuRYa7LnjHCXrByox5plK8AOgTnfOaP/F8tHh2RJd0ft0 pwO0PxPGfxN1Q== 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 4TRSpl58jJzX2N; Fri, 2 Feb 2024 16:00:31 -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: [RFC PATCH v4 12/12] virtio: Cleanup alloc_dax() error handling Date: Fri, 2 Feb 2024 16:00:19 -0500 Message-Id: <20240202210019.88022-13-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> References: <20240202210019.88022-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Stat-Signature: t4d6ja9ryoyexrarrrkpnnkkf49bptnb X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: AF0C41C0025 X-Rspam-User: X-HE-Tag: 1706907632-61618 X-HE-Meta: U2FsdGVkX1/1e0rM+bLVSSuBqz92g6o9v70kbR50t0JnZdqQltjsq+git4ZwKo4gXMS9VGS1ov4QSrCPOt3MeQoN/UBLvdeVlKdzMgTQDmFbNYhd4eCP/iB/IsWPeayF47t4Nwitc4hPWNml7s69Zc58LEsYapDtt4WCBvi5lMUtGqYIuPSIUGztBZ5vh/TQeUV02S50loT1WqJcCGnBF6/oGZemvBhqCBPIZd7gf5BK7m4/WWFVLYZt/cuXJ7C7XcaVTBbevz+4Qx95yXZF/TJENwUr8umy4sUSeb95b9kutGD/F3n4+ObXMme+Kt5eeCtYrFiTy1FyYjZq+YM/ulymqaqtVYkKIdy7C3MDOFThOFEGiSe+QdvCkLF93EftbtnodFHLS7ngSijVHj0hAk4+y2Z8c5erxm4ggV1ifUv7KhGgR5BPcdiKb43yWBvtDNp03DtCLqGoWigi31/ZbZMeCgF5jEMokarc4wdjw5tDtxNXa96/mspZ7Gx/eSnNaHUIexlBFgNdhkXT7ony04mTfxdMxUgrrNyStv++i4lggx7CGgKH9jOBCgq+IXHgksQ462/OOB4XZFwFNCgayR15GfzVk+MLKyENdmdrK8KMozJYfSgb7QXykAnykDePsnOIVcBygjcXPD/pzH+om7WeB/kilv40ApkiHHbGnA17gSD511CrNxBfwxn43OqlDLEG5XiqzOGiiN2veqR65OMK1+SGleecpHfD7btwmhLIULtqQ4OKj+lolevMZHXUeN7yaQn5jtky5NyXvERuOxlW6gC6Lpj7ShkjD5B/UBNDBv4wOJxQKtVVZ/AasNQogYlgN4OZyowh26lgXMQxCzipUE/m/P7ns4oeuk6+SK7A2XF8sKoPhGjTTCPv+ObLCFkuZVdQyJiB5CIH6RvZbNZiMELNJE/qbCDgi54A5W5uZJl5EcF19zOjWYbZn26Hr1UuFz0H4aMggNvhInM OEPY4WN4 JBQNBI0ZQFz+vQKFVXzgkJmdArw7+bvVgNZDz67llP1i1P6Iq7mpbRrHgtGB3XdM2g4h9mKVQsoXIpCwFyzl36eCK0AR96HF82dim6N09JIEpf6UAhltTM74GqP/18urX2oFl8u1Waf3P4z6L3ODciKm58imuHIA6gt+F8HCTC2kfq0NE06T0D5GQyIQgq7rWO75hri6D0kjvI6Z0OkeZaf2e0ZHRJzsQ5JEPC2T3u2G4dvmxsxuE3RiNceRIM1klwhY8OSkoOU0IESn8M97Jw+yiELN+ItgYoJe3garkMRifGVfUsji05WhGuk+9txa2mNUcvx6VRg9OZaG6BFJggbeBdFRanUFUeS3RnSzKwxBectOpISOibg+h9rgaKKECVsHzhZF/v5dlRGUErmshLe4OzVZBqlV3OM3FLdpTdIMaRrVtwR8ichRtQaWOvlXfq8zL0vly4Py/BUxHPowjtdTEbZ66lAMMoHqoc09hfdOkFokzmlZvi+Y/V2SRe+mGN/HqPeQYE0lXziQXli0F2z3WrkDW7TUR4dQ+Pu6PsT03mEHeKcXxaaXv1412ZT9uC4QyAwAD8d39fj/TljLUl1UASDzO1f9w7uG6x04SIx1/gMdHQtBQFQH6JyNGpvDq732U7+8wuf+2yAA= 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; }