From patchwork Tue Jan 30 16:52:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 194244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1356510dyb; Tue, 30 Jan 2024 08:56:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJ/PWNXyq1zVcya81iFdFCbHlRH/9mWY7q2UK4kso6eFq4pf2Ho3zwc/blU8SbiJBMxLaE X-Received: by 2002:a05:6a20:e48a:b0:19c:8cec:25de with SMTP id ni10-20020a056a20e48a00b0019c8cec25demr1699224pzb.12.1706633767802; 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=0HYogdpUTKDtB3Vm+4aH09cLvku/mypaMiHH6HYKOsTuE1XNdIwdTXDky5avn3Y7bT +D9Ofp+Pcwq5xHPgtjBrXMArzQQamm9v4dVP7u6St7RZUm2c2ilNm4yq0b+R9MSZt3rj PmooAJtY6xGmIzxAuPmms6ksjUvTCi/1FPiOXnkqqjF5dj0QeYcbfooEIfl5IRyN7D4F 5sFiifDPFqodYUqYKyXnS6xvl3BwkmTfiWZV0JmTZVFp3tHcVgcUws5O82pJBeB2ra4W kjWrHpfbtdeba+48h2j61UvfW6vJ7DKbazMu235gtXAS5XT2/22LEqS3vX8RWWY6VT7e lBLA== 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=tk/vyFkTLiQku0ad9N/cHEV2e4n++1obKWF1GV2oX+Y=; fh=LNF8sY1sE0MMHV6fh8DO/7oGqxXgSP5eR1Zz8OrJl5w=; b=Q3deNJw3BRBIBjS0hcyDKE7JzNAX4S7SGvJB/3LAxKR6Jthdc2idTTJgwO5K57rcIJ 2TrYk2RRlBi9zqv13//4LFBOAMjRQx7INAWC2OKzZjzLBrBw68BIT/4nENOTuU9oZ/DA ZeEgG7AogzvsnFaBFfI5pDCYUexiVPgTLCmcqoQn4QrcKmLjHybYr5AVWc76d4hmU04q obASKWs/FrXlI4wWsUgGxd2XPS6C+bZTe0Oq4Vnnd5yjhWiGDg2cnjfsohwt53mli8jA yjL/JYVf7G5xMlEDOdCAMoF7/1XILQjlM1aHy7+2XA26PIirOKMk2ZK1wjM/UKvRrl8B YNSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=tq2gAYC6; 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-44994-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44994-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 b4-20020a056a000a8400b006ddc80e5366si7788888pfl.86.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-44994-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=tq2gAYC6; 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-44994-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44994-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 E3FFD28D905 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 1753F12F58A; 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="tq2gAYC6" 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 C8E8D128367; Tue, 30 Jan 2024 16:53:10 +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=CKb6Szn3CB95sG3syAXpmMrQiLSOpx2hDJMFQPwXFJg2ADby8lSAC6oBHyAlYWl1eyC2+26cphR2CVzDfZuQMXfaM4fkkpvyQOi0HAe15XFncgQSwy+AzfXPoqSfAuK1nr5FFdSRO71VTtsIOwterHI+WSm0J9PX4r7kgvOJffQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706633592; c=relaxed/simple; bh=x2kfVQnd3mtJ56l0EVkgCvgLcCn8XobB6WTDFgooC9w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uuTqgZ0tenKUzIdHLnLucSlu9UY0rBV07llA1r0WnAOutS1qGIfJvKUA27Beh8xKmmMiQ8nA6W70sKoAUBxFiStOWByj2sIzCmDvxPFVq8OnEPdUKkVKAND3kE27HV+zedOmGbPqodLf+LcJUldTlsNTE1M7tdzWQKx7qQCZQ6M= 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=tq2gAYC6; 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=1706633584; bh=x2kfVQnd3mtJ56l0EVkgCvgLcCn8XobB6WTDFgooC9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tq2gAYC66u0pgRQLdwQulg5tni9ICP4HQV5hNkD1Cq/9tUIG4HFmibZjHYT0d82Lp cMicqUnPpJnkA5r9jAw2IGJZq1ai49+03rBKiMvJ7+EVVJ3fomY/mGR2UbdmuwD82g 4P1KAEd/fHlBxO4l/WrPaUDLeudpg4vY9nwVSw2A4WctYupqUoslr+z8KBr5VnR1kC PZkebcd46BiUcXGPvLNjvaSeP0AjrYoRbx+QE9XFaoZGhkh7hav+ThwGlx6jS15Qp1 +KKuZLU3CDCOUFn6SKF6TtjyMsTWQ3wPrQ6S5XpGbBt0rNU6SjpdQh2odtFvPnz/1l Gdx4KC/aBtZhQ== 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 4TPWSb5HlgzVcs; 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 , "Theodore Ts'o" , Andreas Dilger , 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 4/8] ext4: Use dax_is_supported() Date: Tue, 30 Jan 2024 11:52:51 -0500 Message-Id: <20240130165255.212591-5-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: 1789535209473191461 X-GMAIL-MSGID: 1789535209473191461 Use dax_is_supported() to validate whether the architecture has virtually aliased data caches at mount time. Mount fails 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: "Theodore Ts'o" Cc: Andreas Dilger 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 --- fs/ext4/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c5fcf377ab1f..f2c11ae3ec29 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4743,7 +4743,10 @@ static int ext4_check_feature_compatibility(struct super_block *sb, } if (sbi->s_mount_opt & EXT4_MOUNT_DAX_ALWAYS) { - if (ext4_has_feature_inline_data(sb)) { + if (!dax_is_supported()) { + ext4_msg(sb, KERN_ERR, "DAX unsupported by architecture."); + return -EINVAL; + } else if (ext4_has_feature_inline_data(sb)) { ext4_msg(sb, KERN_ERR, "Cannot use DAX on a filesystem" " that may contain inline data"); return -EINVAL;