Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2560247rdb; Mon, 12 Feb 2024 08:36:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFI5dBAh0+iJ30eFSjjus8Wj+b3O2g3HftNAPEVL8IalXaBkSacv1cCgtLQcm5kJWqziipE X-Received: by 2002:aa7:d8c7:0:b0:561:4460:6726 with SMTP id k7-20020aa7d8c7000000b0056144606726mr4841930eds.26.1707755817654; Mon, 12 Feb 2024 08:36:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707755817; cv=pass; d=google.com; s=arc-20160816; b=gzteR6lnCVB6zpDi8tM/qQ1Tu9flQEpCu3AV2Tp1G30VFX+ZJgOjdKf/EaHn3oTDKc 1f1s+9TC8AT9oLemp/4WVG35mjujs3KQ33iwCtwsvmY4Yz0u9u4vGzrkP0lfbQ8Mzn3T 17NLimI4ciHjx1nRQuDxr0IqCS5eh3AbyQu8lduthrJF4P/AD//sgCwfwGD8ogpHy/Cy VbzTCl0glSwdiatr+g4UOIPxcZ82C70p2kohg/Ey8JPEdNw6m3Fa/4dQ/RoeGICU3WVx 5AZ7Gs0DmRTa/pxxs3JLk84XVnomwUJWh0h/7fRtlfvhZZ2Cv9+BNXHScAcPEqdd12dG yaqw== 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=OpEa4PbT6VMsXwy9SLyW7YzA56E8uQ2xbEghqtAQ9Sg=; b=BpV4grgNTfQC4FqnWhxEqwmgjp9H88TI7vbD3H75WFjOBO975oE3GJkiZ8YjXhaSfc bZzzP/0oI2cIwXS8GCgn1c6gZWAzZFOp/NszCVdW/HZWHnYIssyMiO3Q+Jo+yOrkymM/ 3Fi6AVve8gpyLzgzVdIUhccOAPWAfKdQ5A09sfLrqwJNe9zi0Rt7Fw+bo2VAJDsWXmso /DiTHaEqS6q2hnhJrEMB+o+om+7vKFXvwF7FtqXCANlrarGPYJCXzs1HtzsSnq2hcjXd qXS8Ni/6pAAZPpsW/fWWwjabH1vPzDeYpX9TIu3DrI3sWGm+Y+yBt7m1rEqT0XtlcQ+6 StLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=VTKykfQI; 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-61981-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=2; AJvYcCXL+VjpnjfeZB315gptIVUzfpt8/ZJoVDY7lfnyWWkcIbjEeFoYSXOk9zrdVSQ/jH0haGXIgTo4gNSXfKBxWOng88ge4WXn+7KC3hjcFg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o4-20020aa7d3c4000000b005617a859064si2294476edr.495.2024.02.12.08.36.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:36:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61981-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=VTKykfQI; 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-61981-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61981-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 6851A1F22F9A for ; Mon, 12 Feb 2024 16:36:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D66B03FE4B; Mon, 12 Feb 2024 16:31:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="VTKykfQI" 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 840B42629C; Mon, 12 Feb 2024 16:31:05 +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=1707755467; cv=none; b=gfjEyfFy4c7hzz8oWD9G7PEJNCeN455idNenfri385KNrXOlKtA37jbwaEq5uHGR1eu+TMGEf5GQ3jAjbNDXm5NeYAzbZpo7CEbey2vMnjVHKTEvAuZXz/Rc9hIoxvb6WI3payP1t9+aKqyW54IicEQNABRFICKrxg31gO9eOpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755467; c=relaxed/simple; bh=CbAyr+xbx+4Y3FlaBdF7mHOoD3AcNitxApGii8uR9rc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qk0QdG1RAU5yuZow/UZyY4m4neUUchI1ZX9lxaG4wRcbRFSsQogLh1qOIGGDC9lWiiBamU+VJtVvoyp32mbX/E82etJ8K1oQCqpbnhxDVVKzZTBxahMg6v0Y29KmGHUUzJQoEGOP6wAaWJ6vUlIpaqoRQReeXbzjt4YlTbGIoYc= 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=VTKykfQI; 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=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> 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