From patchwork Wed Jan 31 16:25:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 194835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp2005090dyb; Wed, 31 Jan 2024 08:27:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzfTvlSSG8W9AgujnCmJt1J/OD094IysBHi5DUrXmAMqcj8W+jalXOiwFSpju1e77T9Si/ X-Received: by 2002:ad4:5ba7:0:b0:68c:6c9e:1c5f with SMTP id 7-20020ad45ba7000000b0068c6c9e1c5fmr2625864qvq.38.1706718429559; Wed, 31 Jan 2024 08:27:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706718429; cv=pass; d=google.com; s=arc-20160816; b=bvvq065CZt807gSFdSt5BcI/OTLuy9ngQCd26pnEPqhbFPwxp5AGlrOAKaII31Tb1K LXpNt6EJK+a/ohLAupC/RuZ0gtHjI+utUiwdh4SXgV4MowPa3z7nxVdea8WqtZEHl16A yPsG1WEEbChbkcvBfjFxJaJvwlzy/+sGJrTkKmbbBrEkbmi8DP5G1zPkmt08Hb43tiCp 93JFQrvn2+ryMoUT7hFDt5xcIdyty3rmPWDsVZQB5dGQi6mL+qhdJ9GjqEIQSEwtfegQ 8bMbwXK7lMMaYYc4Jr3aCbMWqZMkhVgpdYMUlqhhztenmPN+DL9Uc3/Us4ORRLtOHl9c c6zA== 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=Hm+DmDHh5R1llXUPd0Z9Wh5on1yYaUrZBAeah3LbkdE=; b=tWrHhTJyiNFaCjQJqL5rdWdmSrifxXs6SYKiO0NybqupNMz25+pITFz06r0ZzpFzFT 1GTey4q1DczlTEraOnwKu11yw+gOYLOV4+NWzYibYpObToKwCHQrEf8q93JqD6ms8FAr 7909rPSHsXqqWYu1zmJseJuuBuAmow6iBBW16nYVFcztu4s4C/4kWJvY5tJmE6vX28dV E4lHPoG5xWbygqO+AaQICrUDNjvJgO7G1sx75sbSh4m2K7HdWQyQypGE23I8Mq3x928s pZnL4R9xkfOZfizMesw+6ywd/EEBPFxX1tZquH/rX+jar0OChF6WuDKerI3xCYPoAyvc bavQ==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46782-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=1; AJvYcCUzf9Qnjm/6Z5lHyHvaHY7/YP0zlG1sjCS1ZeopnrhD8rEv6te4YyK4O6PC3wEbNbccyf/gt5bAcHw8/hJgEPgLrSsX9A== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ke27-20020a056214301b00b00681725e75a5si12628707qvb.399.2024.01.31.08.27.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 08:27:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46782-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46782-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5AFF01C26729 for ; Wed, 31 Jan 2024 16:27:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B1C912DD94; Wed, 31 Jan 2024 16:25:55 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789623983901417029 X-GMAIL-MSGID: 1789623983901417029 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));