From patchwork Mon Feb 12 16:30:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13553522 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 71F2EC4829C for ; Mon, 12 Feb 2024 16:31:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 28DEA6B0087; Mon, 12 Feb 2024 11:31:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FD416B008C; Mon, 12 Feb 2024 11:31:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2A836B0089; Mon, 12 Feb 2024 11:31:07 -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 ABD356B008A for ; Mon, 12 Feb 2024 11:31:07 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8F8AE12096C for ; Mon, 12 Feb 2024 16:31:07 +0000 (UTC) X-FDA: 81783691374.04.A8DA91A Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf02.hostedemail.com (Postfix) with ESMTP id C2E5D80034 for ; Mon, 12 Feb 2024 16:31:05 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=VTKykfQI; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf02.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707755465; 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=99RRntZfkjnZKNO4IHwslOkSnOz+slrjRxiaktTh4zQ=; b=YstIAn2CpJS/ruZ7QSom9yXqF3UtcnGYztlkIiDgRYNngfkpoe/95TlPDXhrFWJHRpDYrd jt6uOkH4fgoVF2oFvjARdYsHoAB6knEVOyNAkINb53ozeR7/2Eh6h6ItM+aOhxXsb93orb 0FQVKMBqUNMae1rxJRSF7rolSt86onc= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=VTKykfQI; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf02.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707755465; a=rsa-sha256; cv=none; b=d48ZPcyHEkCAfpUygqUfOItQJ542j0aCDbxUf29ecUkq36jnreLRXNT6y98ftRZkZ5gwOV sK0wk5LtWlediBTgMqQGTgqAiYJBagDV1i6tsQ01twM+yNpr+ztKlir+NlXt4J5lQPYLzf AK2jkp/8N/QVB55RkfAKSpIxT9p/BWE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707755464; bh=CbAyr+xbx+4Y3FlaBdF7mHOoD3AcNitxApGii8uR9rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VTKykfQIFeg7MsgPwyNK/d6uzEToAQ8FlD6SGX+bGDjm61vIw37jcpX3CfF8gVZCC oJfrLVqcmHnyN8EYEAo12aQFH0jE3PqvtX9puwfbJ8Dy7S9hiSIDtRAdBQB8Y02bGh 1unKHeombD7OmhYiMUdmNLEAww5/+i91PM0mB7JcWV7MY5rVP/J9sD9da10k4HhwLt HWHwDADStQviiCfDbETS9uwAi9jnPHveF7qMZ55QfbukSsZwklpu8abwXhSF825/4m QjgFOnuVbF+GUg1Z8zB+c5h3k9WoZBREVS/p9dlZAwel8/0/um+lsrPfzh92XZ8bA/ DZw3KbUi2kHOw== 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 4TYVMD2VHMzYQy; Mon, 12 Feb 2024 11:31:04 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, dm-devel@lists.linux.dev, nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, Alasdair Kergon , Mike Snitzer , Mikulas Patocka Subject: [PATCH v5 3/8] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Mon, 12 Feb 2024 11:30:56 -0500 Message-Id: <20240212163101.19614-4-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212163101.19614-1-mathieu.desnoyers@efficios.com> References: <20240212163101.19614-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: C2E5D80034 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 6jguzbytctuzryp49kkwn5xnqpywe3r7 X-HE-Tag: 1707755465-406415 X-HE-Meta: U2FsdGVkX1+4b+2doyWjdlJTkz6dQT2eOXXU3UdEZz3/t1Cwzqcds1CkRKq7MyO2/ieLGbc6etXCrw6TAuxEHHaFljq5vzpMNVpNbKWFyZbMAqqJAWP15dPowkKcSFGcvfY9ZbPgPvaNQwgV8+4ASekP8TppOjVezuKudd8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ttOEyds6BgHjF98ErP+A7SSaa7ww/3WpeByEv8IwnoygLyi6ybPcwQJXd93zTw+67e2UgfC0cabqMM63mqR2g0KAxvHHC93eZ9WmeqtH9XrhjEr0irWhP4QPeEWS4uxpoK/TKZODgswG8NNP0sXg5ZoHewftw0gZUONSuPfkkkB0oiN8MgcOVnpfx0AbXMXYBEeC2k/zjF5NhGjhMd95pmioYB9TCJcs7UIfIPU5oSmrqMgW1qTSrJLvzW4vDyuda5Gtpz93ysmC4chTNR2BBHs+Sn1/tki6wlyiqHYWi6GrC/VKPvDpMATDN++/kRa9K7QQ8O959OFPAwmAPBd4u282Vy38fgylRMqy1vk5/tVbd1VkIkFDYxIg/gLEZGnoxFHi8= 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. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Suggested-by: Dan Williams Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams 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..acdc00bc05be 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(dax_dev)) { + if (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; }