Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1151095rdb; Tue, 30 Jan 2024 09:16:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOxUoDNpjcEejRyT6AGUTAJ4QB/W1Kv39eJKfhNREOejcBk4luA1SaTlNPc12dHJhIDQde X-Received: by 2002:a17:902:d544:b0:1d9:6c3:e24f with SMTP id z4-20020a170902d54400b001d906c3e24fmr3066092plf.38.1706634964228; Tue, 30 Jan 2024 09:16:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706634964; cv=pass; d=google.com; s=arc-20160816; b=w7IC8I0PfAoiXmT8QtEBHeUug3jNcaWctfu5oZZszPbcnRjXZ5GzIJr0EmS88qeejk XSjJm6I8Ltx/Y1OoLIcFpoH/Ti/w3js1kxKy7GckBH3m2it9aZJq376ugPP0tYAwPfPX It394G72kSTBKKFyg34WDkO+uC9j4aM6UZDsmmHmMk8psUrDARuU40ndqjCw930hIaES BV/0OyGGphbLoQJKxxO9IxhSvWcKjno05uvUCGpD551DrGHPpnDZDw1TUIF0KtfMlI2A wLH0kEn2t/3QzB0S7LMUov5JdZCyreEv5KBszkxhpTtvSy1MFXW/zeiR2lt3rNz50TT7 TLtQ== 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=XkDGYWTI60Abcy5+ZI1sU6Hpo9MTJxKHGwT6DDETt4w=; fh=NpknN67sf7tHiBkZ3Z4MhiVna3u/Db498jxHdbu6tRo=; b=ALAxS9nGxjs6yKeHy+cxABartvJBgUvETyXhzjT9SKGhsMd3VfJgxTlkKfOv7ki9rE tit9U3YJFqgqzY0fHETKvTzFEsjz61inrKibc0OZorRtBpnBNop6T03Z3dj/S3qDBvTx 4yfpVY82qO0g8WfmvNmMxaTalbiznFGPYCAphSbOmOgwt0ph9YcyioD6sgTQ7NaJr8SE i90vbNITKBrXiCK2gYwwgGgrskciV8rMbZOB19icmmcaQbl22R5LM2mxBfWalLh7xqLU IDMqyEBhi6gE2wOg/6P8BTOd+XBbcKlmdPgl84X33oMk0jHIj1ZMaY7L6M61SLqSknCs uR9Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=vUW+mrCc; 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-44992-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d11-20020a170902c18b00b001d8d54d83c5si261881pld.94.2024.01.30.09.16.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 09:16:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44992-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=vUW+mrCc; 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-44992-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44992-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7A22EB28D2E for ; Tue, 30 Jan 2024 16:54:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B87A812C54F; Tue, 30 Jan 2024 16:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="vUW+mrCc" 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 AB8F21272C7; Tue, 30 Jan 2024 16:53:09 +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=1706633592; cv=none; b=SuDLunFaX+NcspfMzHj70hLHKjaAZ/j4HFEH1e7Zfy+2BZCpOUi5FGkTzj0P1UNObAoRggoIAWhjaVxZ2i5Vt3F+cuEh/Rl4GfpaypkjuA2SE66vTM2a1yW7F8tc6A5YaLWtUZzSOzBCu84r6tLy4X3v7vu/Ry0gplPGkCjIsbI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706633592; c=relaxed/simple; bh=0PS85pgqYkHDjLA73cFZbQVUmxCMDRqh5f6aZ/uoEXk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e8QvaRPzmS/TdA2NcNrF2do3jshUfyRekMUMZOukyX/34TRHDEK48Uehvp7xIUNw6g9GvHV2BdNGSa2r+T22pfuDrglcLgclSxBWBp6uywQUAih020O51mFVRsBNM10ZLx7MGRdb2PJd/LVcXYHwCLPQ0mIJ+610PwgGf23CRvE= 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=vUW+mrCc; 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=1706633583; bh=0PS85pgqYkHDjLA73cFZbQVUmxCMDRqh5f6aZ/uoEXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vUW+mrCcZJ4dUccJT29E29VuA+qTOl+8e3elS1H8wklVOGgzACBmHhdGQO2dr9wFc NzmKK48zJopQYpmyMRRoNzkvbAyZ9Dx2h6XNt9IiA2jyvMzy6nKiCz8WIP+Drq289Q /v/bHSswSZ3L7qe0ZvMi36Ncgfgj9O/uvrnAoVZmMH/ijRtHijayBfYRa9WEMZjCDs fxJd4WCacVrY0N8Y5MFgIjKCQ/yblMFig4tScU2lcNuoZD+S3w4o6Bd2GdmM6XTzYq fRa79UV4L+X0luZ8p+mn5pmw7UK7or0yOzymRPjVduus21EeKbDkDW2l34EAE3oBYG VELmh3Q36mSVA== 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 4TPWSZ75XdzVCS; Tue, 30 Jan 2024 11:53:02 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Vishal Verma , Dave Jiang Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , linux-erofs@lists.ozlabs.org, Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arch@vger.kernel.org, Matthew Wilcox , Arnd Bergmann , Russell King , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH v2 2/8] erofs: Use dax_is_supported() Date: Tue, 30 Jan 2024 11:52:49 -0500 Message-Id: <20240130165255.212591-3-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130165255.212591-1-mathieu.desnoyers@efficios.com> References: <20240130165255.212591-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 Use dax_is_supported() to validate whether the architecture has virtually aliased data caches at mount time. Print an error and disable DAX if dax=always is requested as a mount option on an architecture which does not support DAX. This is relevant for architectures which require a dynamic check to validate whether they have virtually aliased data caches. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Gao Xiang Cc: Chao Yu Cc: Yue Hu Cc: Jeffle Xu Cc: linux-erofs@lists.ozlabs.org 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 --- fs/erofs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 3789d6224513..82e569bd5889 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -644,7 +644,10 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) } if (test_opt(&sbi->opt, DAX_ALWAYS)) { - if (!sbi->dax_dev) { + if (!dax_is_supported()) { + errorfc(fc, "DAX unsupported by architecture. Turning off DAX."); + clear_opt(&sbi->opt, DAX_ALWAYS); + } else if (!sbi->dax_dev) { errorfc(fc, "DAX unsupported by block device. Turning off DAX."); clear_opt(&sbi->opt, DAX_ALWAYS); } else if (sbi->blkszbits != PAGE_SHIFT) { -- 2.39.2