From patchwork Tue Jan 30 16:52:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13537741 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9AB8C46CD2 for ; Tue, 30 Jan 2024 16:53:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07E626B00A0; Tue, 30 Jan 2024 11:53:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F3CA56B00A1; Tue, 30 Jan 2024 11:53:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8D9A6B00A2; Tue, 30 Jan 2024 11:53:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C973E6B00A0 for ; Tue, 30 Jan 2024 11:53:06 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A663AA09AA for ; Tue, 30 Jan 2024 16:53:06 +0000 (UTC) X-FDA: 81736572372.04.C988C29 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf22.hostedemail.com (Postfix) with ESMTP id 0F071C001A for ; Tue, 30 Jan 2024 16:53:03 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=vUW+mrCc; spf=pass (imf22.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706633584; a=rsa-sha256; cv=none; b=QaSyqrG1KPVC4tS2FLS5Bjz4UxmE3kdIHI5bESXCZxa0JZcHgKYvaek9PVUInEn2BErsIK gsMA9TLHHtgrkp5XEaptV/r1xdsyrlx9ihCWl29JNZFjqS8bvPVVjiz334H7JYNPGgd3Rk EYYUv1o5LuprVs/4eupSA7sO7TYnRY0= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=vUW+mrCc; spf=pass (imf22.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706633584; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XkDGYWTI60Abcy5+ZI1sU6Hpo9MTJxKHGwT6DDETt4w=; b=WrV2jrd8UahnOE/n+fK/ZFepMI1a2ivxQvMfMqg/g8bXcMb0B0Rwfuxs2/jrswFRJMol3i l//ZJWteJbgtpSMKHzRKMeGyreBludt7fZjZWvtsiykRVWDDCTITtVTSjwdUJKhBTPlcLu LzlcA1LPcpB0PKyQ5TGWMvGrqZgrhWw= 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> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0F071C001A X-Stat-Signature: foudit4t9886r8r5g4et5wob78ya4ofr X-Rspam-User: X-HE-Tag: 1706633583-789357 X-HE-Meta: U2FsdGVkX18ZGdpt2JkI0lOTvLoA6z96TpoLN/5ZMh9Gxs/92sczgEE1XyoPeGGcsxCXJd4Wi9NrR1r0oKwyD/IsyzD7ny1L9WTbHUxZKiJIz1Sn5sWiaaLBXL3evv+NOUILhJMiwC3cQzKB7oiTTIh8m61nlPo+/XcT2F/LfZqdqqEvIbq0/UH+7bTcgEfj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XRMFD5gSjLuL5hR8xlT0ZJRiP8OW3ytN+a908fVsYUGxlJ5GsVePfCm0xUFh+ooRzjuBGxOK7rOvkIhuuQnjALXxd1vNw0H5CghwTkWNsTR9TvCigtfa2AqxTNiKaWwZ7XM74vG+QOn+v6ufiNhxrxVN9BgXngo5d3RokA5sPpmxCT8uoQbRAdZhEAe4tPf2m2+5/ESMXwIGFcAvVJvRwGAyAfGBEpED92r5f1Q7FtxwbXOyt2UV9t+qMPw2zBdE3qlXUj87NPBzLh6G6cnz59GTqGsAQIAZupb1eRe0PQ6WZe7w/OjhNzGeeDoXyTH4iew0gaaCOxE3lqtpf6calHctKixX7PIMNYIiG4Lj5WwB7zcIXtyQRKEuJd01z+8y1RntbvB9Vso+TNG3Pe9K6A5+wznuLVxEFULAdlgTNeFQyUeEnQ6qGPNDkUEyHSioO4VO9oRSRb0An+koXcNTwZiLoTtDaqeQx3GAxubn X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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) {