Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp501393rdb; Thu, 15 Feb 2024 06:47:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWatKrMqyQKNZDlsI+YuU9w76UBur51eKTY2ftsz1AVA0/SOpJUNDr5b70WeQwMt9ohuA5PnCpcEAR6KX0Zlc3+VAXQJo0SfGDmXfZChw== X-Google-Smtp-Source: AGHT+IGK7i5SEDD++4BEHFJ27fVR/SaNrnskLlNl2jMbT5Cw4aSwf4iq5r/lTzYXF7Aklgdxi6qt X-Received: by 2002:a81:ad28:0:b0:607:838f:8991 with SMTP id l40-20020a81ad28000000b00607838f8991mr1657299ywh.38.1708008470623; Thu, 15 Feb 2024 06:47:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708008470; cv=pass; d=google.com; s=arc-20160816; b=vAeifhsNc+5jG5aG8GaRCuLeenSLQPZGzXmO4VVFQpnDLuFmRvNJcl9bX2sItNEKts suYu0kvB73wBUHdZpWP/dJ8SIqvmuquG6vf8qHifDSCkWgLMFNL67GVyRBTbMRZdGsru Q5KRGg2EqJF4TEIAXzWldxbZpOnmXXfVOS8MNgJRvThYQI0QC7tc9tUhRdScsb+SGwqJ N1oRkhAGLdNxzJvroWLQp3tC5FdxZiuZ+gvuTq/Oka713vy6oI/WUG35zKxGYpH+5DWl 6FZ9tUrXAguGfXdl4TB0oImM60v7+RA1+X8UtJd9kWHrwyzNFdicfqhwreHo7LymUEo2 aONg== 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=99RRntZfkjnZKNO4IHwslOkSnOz+slrjRxiaktTh4zQ=; fh=vB3mjx618UEkjhkr0KlPmbcjzb/dBtVqarMo/Lep1XI=; b=JDRpRYNC7u4vvEzRa/74uTES3Jjoa0HIpwIC3Sr0VxhRG7UOnGPg3duVAudINjT54i 3lwU6JzN9wjvxP2wn9F2/BVSJtPq2fhwSLkMCTsLaNYWNmn7bWONnXaqhBLGNgriv29+ JyzykPCYISa8/V8r6PxTkm0FllKYspPlLHr3tOXWz3K+JkE3xwhtGGGSHn07krlC5GlF fbAo5MqhcSQIa4Vak/wpxsa86OGJ0orQGWli2vvkGVcKHv2zz1N47r3i0FpMAsa7b1aK 6//VRNl6FfGsfynU/9FarminVYseifSnuBIHdgHXtkNmTc/+yGdl3h/crqOXAq7v0c5C VLNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b="XTpVv1l/"; 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-67098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g2-20020a05620a40c200b00786fe4117fcsi1746684qko.388.2024.02.15.06.47.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:47:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b="XTpVv1l/"; 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-67098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67098-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 616401C235CD for ; Thu, 15 Feb 2024 14:47:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B978E13342A; Thu, 15 Feb 2024 14:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="XTpVv1l/" 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 8F181132478; Thu, 15 Feb 2024 14:46:41 +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=1708008403; cv=none; b=B3xy5vUlZOdzWx9BaGQu79ZLqn/bIZu8D+4M/hjXVSyKTGHgireohcfVBsCF2vc/eXJ7wH+LcZYFkBm52aJkjfz0xMeH6r758wB5H9Vofb5FGRFeM+0tMSsjH8380hLM8cTUq4nbJAQIYQ1PSVoPV1qJSWhmaplkf/61tF8d1DQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008403; c=relaxed/simple; bh=CbAyr+xbx+4Y3FlaBdF7mHOoD3AcNitxApGii8uR9rc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XBhfMTcdYsJBmY6fV+lWhctVryYp4EqqoqYyNkfCO9UbB/w8yVkKpiBK9/CUdavbrmh3tcEmBmXSjegKv+3u5o4EldeHpWrLyLxfi+GuKQ+QRSzt+d36elndTgX4kuCMCo+eEcyAzmBwWm0NGjnOkhzKzOL9f2/8VESD+enkoCo= 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=XTpVv1l/; 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=1708008400; bh=CbAyr+xbx+4Y3FlaBdF7mHOoD3AcNitxApGii8uR9rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XTpVv1l/pjHHNr/U9lGiMvjnyzdscOhWEb6ykHzU4BnNVVGkTiYLd4Tx5bn9wJpuY 1xnc3pkwfg+M3BljN/02HFFNaMUAyD6Boz06M9Rh8HV2mNyDQisIGkcZVpbJ0IzpdR dXrC+dgmbqmUM7NRnW85PlvvKT1jYCmr001F7dcL7aw9qiFtxBRP+16AAaISFw2SnV lYhbueW3D0I3zXcZNv6tl6dVUeIRfK7mpePFkwjLo5kJySt2w5nujyfKoofo705W08 GXlnb6d0rF+7PrW3/qID36u/xvDuI+DfEUxSj3H4A1AShvd5J30FnvinHMurIpGs+m hhRboYpCWg3VA== 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 4TbHvN3GlZzZS7; Thu, 15 Feb 2024 09:46:40 -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 v6 4/9] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal Date: Thu, 15 Feb 2024 09:46:28 -0500 Message-Id: <20240215144633.96437-5-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215144633.96437-1-mathieu.desnoyers@efficios.com> References: <20240215144633.96437-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() -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; } -- 2.39.2