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: 194243 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1356506dyb; Tue, 30 Jan 2024 08:56:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcfG72Aq9fFadq8embJZG9DyoQOJEdj2vTrPit3usaZW4Tvbbl9lKZ/oPAaiSjmxghI3Mf X-Received: by 2002:a05:6a00:1ac7:b0:6dd:e2b9:d4a with SMTP id f7-20020a056a001ac700b006dde2b90d4amr2233477pfv.26.1706633767256; Tue, 30 Jan 2024 08:56:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706633767; cv=pass; d=google.com; s=arc-20160816; b=Q3ltCqcAiSzBcFlCOv9AvQh3yXwGzbqc4cpPUpquEDmPXgoNd45wjjLRH8Cr+5iwf+ JczFO7sO+lVOXK79mj23aBrT+DCnNUmVogwBIVRHq5gfFWcwY97mc6eW6w6nBMtgRsuT tLSNz1G7Y8IzqXyynl6g4THcYsTW3sJgwhI/fSoqgsYmfNXlBwkZ+OI4GexXyWUFsSgA BK7p3dsuiExebu5Q6UJLtv2wsJ9XguhcKTTHCfAHJNMvmiK0HP+92ykXRwAyaTb0ziFl 2wdemf8IsLlsvh8MPam8J6bmiEqy2xrFmLckwTaVlulEutJMD+EDKoZf5RggVsfj5kFR HbYA== 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=/Ywp2OzIEO3UrKlV5UlZxaaKEM3XQLGE456Lr/j78Ws=; fh=lDTZ44s5QROZ2gXaPhKhNTP82LKxPjb7KuveKc1awkc=; b=uqhiqK04jzKXF31hP/ZLTMa1YMcAN+ijk3omCsY4cE2EHbiaNBMqYl3BEazXqPW6qo KBFdY0uaeNgVcxtc1KLfe+VM/abTCuf6l1U6+b4ax6F45aopo1FQvmWaq5r/OA+7pwOA 94xzT08t9iVwNE2/CYczvLEg9MNGONEbjZfBSsm4qn8CJRKapeyIuxrbsTGb2lZLf370 JOqKerFxG6Nj650mJpAmy5WRYySK56/K2ovaX4Uwdsa7NkD4tZnf++Yse41ppQ5vfsfV eNYpicgUBVjAdYVukcx7+kjkjyPRtXDoazS22FbnPRhEEsNRZw9FcZRoa9KgQlGBi83b BZuw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=Wcnaeton; 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-44993-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44993-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a10-20020aa78e8a000000b006dde3ecae1bsi7747838pfr.292.2024.01.30.08.56.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 08:56:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44993-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=Wcnaeton; 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-44993-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44993-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6B3AB28D900 for ; Tue, 30 Jan 2024 16:54:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1724F12F589; Tue, 30 Jan 2024 16:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="Wcnaeton" 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 AB8B41272C4; 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=RNhhTa20+alBOi43RAV+PMUzm2rZs0arc8rssEg5Jp6//3J0m4tjI5yrMuFd10Y49uUYyi3ws9AVWGbqLLR+PIbfmVPU8fyC4ioAl47AceyBsOTAhhg8VWg6IA6z5tWSaYW13niSxmbKgQ7F8NYqG0zBEK7XYl+Hd+OAkUN3afY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706633592; c=relaxed/simple; bh=uiS0GJbwiYIsdO+sIgYuUHJda29PtI1SD0eG+t25LF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KGFadOUJgFCxyTEan/uaItEoMrE9UWSbg2Ekkg1RES7iLfwrtxj6chTury+AtPaLuW4V8N/gqbutHLIPS5h6aaAFxqrCgZmfyAplII2GoHCl2vRSFE9lBiQ74Pbmn9jwq3+PqqFP6UZ7gQqK5UPBgPTdr/Gcdlyrs+hfr7z99PU= 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=Wcnaeton; 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=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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789535209282953895 X-GMAIL-MSGID: 1789535209282953895 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);