Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1767765rdb; Wed, 31 Jan 2024 08:28:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYcfJd8iX24HoFAM+Pn/hnUVzeExdxtz8XE46cdEn2yxobw9lVoFCpc3ptqv98YimMaukz X-Received: by 2002:a17:906:552:b0:a35:a1dc:8920 with SMTP id k18-20020a170906055200b00a35a1dc8920mr1489499eja.45.1706718523766; Wed, 31 Jan 2024 08:28:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706718523; cv=pass; d=google.com; s=arc-20160816; b=rv9b+NA9BNBWjUGWsErI7WUB5eKkSGpBye3ti28r2BHkdAiL2mGgNSvhPRuexYAiR4 SpPWJt7JowSH64rat/T1nJRZdLryWQaN8sqIa7mB8rZSVIgxGgzlQFtjnZ11Uas9yw/0 wngblxw+eEpCnfLzgMCOQEy0K2PxJ7lof8Euab+tQyU0Rn27BDne//8RAvxwBWABLSLR /48B6XYCy/7XSLSmb5kG3T983Rs4/ZDhclAy9Dp1inEex0D0qwPXEYQ11gjwhOQNMl38 nAzqLmlOlDFiXoprFSkFCtm4SVwr2qFDimD6uvBlZ7mzEsccrRVklqx0i8fU6z8CeL/v /DSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Yt2CHrUIXOlD7LqPZ+/R1tzDg+XB4/CnMmFyvBmU2Ok=; fh=yAJc5RchsJjO6vmNhm9y6jR8XgWk3d8Nl56QNvWYzM8=; b=cI5cTQweqo/MewtgLSut8mbB8kbJGTfuTFxOSRjPlFzNXXOOYk2PPZhIGWD4Cmny5P qeXyz6GGEtKxM0bCan0uXcsYpuZLOwqOxiG8XBhEnOlIBIv2Cf6YuIJ9IIV11wgHtgeq x5fczLGqBGhWMHmrgrX+YDI8W1CEQ9zxU7cQWSs6ubM+oEEbGiE+BaYrsnqf44d3UrLl coAWZauijhs3+Zr/oHwlP1hxOhgpR2DmxPE4WCbv/faUNiPB5gCgmiGitrSlXPOAee0B klYb0alGhKC/ZxIH3XeGvfavbSJtBxHFsvQkh11/5XVBw2C53tXylEn+ErMwLRHj7rHI UFMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=EB06hVwq; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-46782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=1; AJvYcCW/j+q9oY4XmW8V9NqgsSGZ2yqgV7PCFOefzpJxyrR281qLzEeCultXktHnKgb3gVHONcr2nISmdsfBk3fAq8VjA/LF+086wGkuOCB+Uw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m21-20020a17090607d500b00a2a4a9e8b92si5632997ejc.940.2024.01.31.08.28.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 08:28:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=EB06hVwq; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-46782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8EC231F23224 for ; Wed, 31 Jan 2024 16:26:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F26F012C54A; Wed, 31 Jan 2024 16:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="EB06hVwq" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4340912BE84; Wed, 31 Jan 2024 16:25:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706718352; cv=none; b=cN37HzENRRdJ4aDAZc9VYVuyY22dQfTtayKZovoM+oRula9L9pNTRim+ZJUHLgHvcB4hUuUmv5s3FYma57KAjCeTwKxQTBJclAmuvdn4aJMJX84T44/e3+TATN2Pz94xqTndkIzX1a6DdeJns2b8rvUSZdEXXKwuUm4L9cSjCcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706718352; c=relaxed/simple; bh=CfmY1KnEab9DsMrJbyvT5LgUiqxfD1jYSIdakS3IZw0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tbKcMQBSUrsR8rpHTTORn6IWF6PB+hFsj18Hgec8Gwumki0WjPbtREbt+BNoLCBnNQ42Fi3S6txHfuA9DXLWc4NH0Zjefg5moHlfkaAsqf4fNx9T33MXUYCLnDvCmFKbeu1X2x23U3ToE6Uz1PCCQznathcid6Ppi9FPvlMH0pE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=EB06hVwq; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706718348; bh=CfmY1KnEab9DsMrJbyvT5LgUiqxfD1jYSIdakS3IZw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EB06hVwqH30Biu+iJCPUcv/terkIISNlE4G2KLYR9OPO6YHERtB+CQuC+sUJ11GiS qanrhIUz9PaLQE+1Sfk0euf5aZEOnEh0ZmU+8GuZPFIs/dUfEpFpY4aR3hMNoQ0M4K YjYn8N+vE1erhhgi+WRevsbvvXyXBUbecJrhzvF+suEsrIh0Is3m8q7H9EX/5wMjZ9 p0E0sTMQLq4kN8hV//trJ3mjwoImjOLdvL5YGOOOSyKl//9q9lix/RG3EaWChntvIr cfkBAkZwRIFFgomMisFAqXV18H2U/8TgTzIZaM6+spiKRIWy+N1609kejZ5IMCInoX m8KJF4ssXA/MQ== 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 4TQ6ph0mWTzVnx; Wed, 31 Jan 2024 11:25:48 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Alasdair Kergon , Mike Snitzer , Mikulas Patocka , dm-devel@lists.linux.dev, Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arch@vger.kernel.org, Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH v3 1/4] dm: Treat alloc_dax failure as non-fatal Date: Wed, 31 Jan 2024 11:25:30 -0500 Message-Id: <20240131162533.247710-2-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131162533.247710-1-mathieu.desnoyers@efficios.com> References: <20240131162533.247710-1-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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() failure as non-fatal. 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: dm-devel@lists.linux.dev Cc: Andrew Morton Cc: Linus Torvalds Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org --- drivers/md/dm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 23c32cd1f1d8..f90743a94da9 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2126,12 +2126,12 @@ static struct mapped_device *alloc_dev(int minor) md->dax_dev = alloc_dax(md, &dm_dax_ops); if (IS_ERR(md->dax_dev)) { md->dax_dev = NULL; - goto bad; + } else { + set_dax_nocache(md->dax_dev); + set_dax_nomc(md->dax_dev); + if (dax_add_host(md->dax_dev, md->disk)) + goto bad; } - set_dax_nocache(md->dax_dev); - set_dax_nomc(md->dax_dev); - if (dax_add_host(md->dax_dev, md->disk)) - goto bad; } format_dev_t(md->name, MKDEV(_major, minor)); -- 2.39.2