From patchwork Tue Jan 30 16:52:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13537742 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 94CBDC46CD2 for ; Tue, 30 Jan 2024 16:53:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A5C546B00A1; Tue, 30 Jan 2024 11:53:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A0AA16B00A3; Tue, 30 Jan 2024 11:53:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 835CC6B00A4; Tue, 30 Jan 2024 11:53:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5F06F6B00A1 for ; Tue, 30 Jan 2024 11:53:07 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3179FA0C1B for ; Tue, 30 Jan 2024 16:53:07 +0000 (UTC) X-FDA: 81736572414.26.4053410 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf03.hostedemail.com (Postfix) with ESMTP id 603AA20016 for ; Tue, 30 Jan 2024 16:53:04 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=Wcnaeton; spf=pass (imf03.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=/Ywp2OzIEO3UrKlV5UlZxaaKEM3XQLGE456Lr/j78Ws=; b=yJrAE7PBECqHm7OV9xoAG+ygXALvTVAMf2NzQXrrvS4TuSxhrzU/Aw6ZJmhA8n9lCoJjui Z09krDjcceU68szWGBu7Hdvtq0hvIilAvdaZhKSZJK000eekj8UWVboU7bI3b1ZrJPljS0 HijSgdIxFMH0snNWuBWsnD7THNEhS4Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706633584; a=rsa-sha256; cv=none; b=xOMKwB4ynCbx82iYdzZSiLM/3hXpCNoHeI+GIfxU+8a9FVssR/Ge6gPV23WpyOuZk0Zmhf y6TgCw/jLJRLbIcNuP2uWo22tCCBceowJ0sht8pky4ty/Sd/ePl9a+exM64iO/pFCtSHaV u6OrLyJEYtjYSMFP5d17Scrg+S18/eE= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=Wcnaeton; spf=pass (imf03.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706633583; bh=uiS0GJbwiYIsdO+sIgYuUHJda29PtI1SD0eG+t25LF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WcnaetonRB2ptA6rH20S85ZN2YuQ+85XKCChqN/hPetKt9hQMa6MYuz0WYUDKu0dk TRGXuMhSd/MORPXaikKViQvSex0XCt4qww89GEbtegcsxugJg/8FWVmU0KleFZRdCg URgK6HV/mhdB93faG1hohYtpg/CFikQ89UPVO2+6YBcInuB/TQTAvO+CrRwLUkoP7T z7OOTR2aZt+IPrulE57GALlHaC/QeSShs+vFVabk0vuwHLfQxrsFjCnepf8ePGwLlQ RlY0xR0urzM2jWXOR+egACe18PkdIYEzPUmiqu3yKbeMxFrG6CdDKqTLmZedfeFS5e mXznuQ/oV967A== 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 4TPWSb2qKWzVlT; Tue, 30 Jan 2024 11:53:03 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Vishal Verma , Dave Jiang Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Jan Kara , linux-ext4@vger.kernel.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 3/8] ext2: Use dax_is_supported() Date: Tue, 30 Jan 2024 11:52:50 -0500 Message-Id: <20240130165255.212591-4-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-Queue-Id: 603AA20016 X-Rspam-User: X-Stat-Signature: hc5u9refs5brr7k9y6rkyibqquf89u1x X-Rspamd-Server: rspam03 X-HE-Tag: 1706633584-858955 X-HE-Meta: U2FsdGVkX19e+GGs2QeGbcNZCYFlQj5yPv4GhpZzl+tKX7Em2ubCfeD1362xFAHyajhq/zeYEAghcsFOLQY/2fSq6bwV7yxpaNJYZaBOzFSm4X49wB4L2ie/jPWv/qD+nqF7w+f1t9QcPYzfeRITiw3gP6pWiTZT2C1cU3f7HYgLfI5Akw6/wg9zBs/7+pKtWvaZBJU+nDgYykMxvUTtrG/dVob5wpQOS3SLb7zut5Zrr9Kinb5q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ur0AP1vXAx5VWztSvc9Mix1Dvdm501DjIDYPGes7H5OJny162MTUQdBjZwf1RCvchcXMzPbnO7J5SDFgxAPsCmw+e1eB/LO2i/BBL/9yqJEVVkejuLiGObLRUaHZ0d006jrZrTYR9mXVBwXUdeYoiV4UBLl2GTvOqAIrPjVTcVYKc2703xIH+7vsPWmA/g1nBkiaCHsdorAv3CLVw+9dXPZatsqtGd0K/UFcAHqJRTszLTGtzvAs6UG9kbigo3iPQHF5B+IdtEBbhMJbkdyuvRJ64mfqSe3U5JSA6ObdVwX7342WCxeAeiJsZUppLbKxk3X1sq+TVFNbVPLJ1xrXC5Ri2FL4denu0pIGCTNNFNLKBfVJk4= 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: Jan Kara Cc: linux-ext4@vger.kernel.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 Acked-by: Jan Kara --- fs/ext2/super.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 01f9addc8b1f..30ff57d47ed4 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -955,7 +955,11 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); if (test_opt(sb, DAX)) { - if (!sbi->s_daxdev) { + if (!dax_is_supported()) { + ext2_msg(sb, KERN_ERR, + "DAX unsupported by architecture. Turning off DAX."); + clear_opt(sbi->s_mount_opt, DAX); + } else if (!sbi->s_daxdev) { ext2_msg(sb, KERN_ERR, "DAX unsupported by block device. Turning off DAX."); clear_opt(sbi->s_mount_opt, DAX);