Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1137351rdb; Tue, 30 Jan 2024 08:56:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcA9Z0dI2lhy5NtQBYhxT4yCAYUIfJU2stPv6arA2r8qNi78kum9wJgAF/AhmMAh0hBX+H X-Received: by 2002:a17:903:40c1:b0:1d7:5b9a:c121 with SMTP id t1-20020a17090340c100b001d75b9ac121mr9663697pld.20.1706633780720; Tue, 30 Jan 2024 08:56:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706633780; cv=pass; d=google.com; s=arc-20160816; b=BMAtA0+g32boif36MA35kJ/cDxYDstABbo3MIN9rk4cso4+1KPT3vNSZvLBKDDFw8i VFrvCQJHigEVzYd0x/5D0QIo67HDSFu75weiSclqU+/CXRBf1PVbnWatDAt0SjrXFzds /0hkMJgbjyK18rIFs8viPplTRZy7AEnQUccvZ5bOabeuC6RQuzcvytwD4kEMEPRJIEk8 gdxD1pA6jZ6ga8n9JybnhBo7MhiVZE8Y1pQwtl+D35W1V2m/0ztLUNmCTNNMOGRrKrOS 0nE7vliiZPrhOaKXZV0uVqJx+GfrSTsLv8keAzBokZV1F9ozrUM/mlzlDYdOuZmQP1ne lDUw== 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=C1HMlvGu42Plp5r2VyEDFqQXOtGIITlr8J2Fj+qB9Bo=; fh=92E6bQh0MDKP5TD6CMvcCDgHw2xKldJ78TdSFYHYFcA=; b=KOllp7TU2NOd5CBHxct9Z/LnjT4XD6AGH9USyCuw7L9RENZaopuyLRkuDsZfhSXw2Y /KCc3tMVzsPIB6lGNBIuVM7eXNSvFOrk0j0dPL6HMQTMBhq2re+nHqSf2k5iIPCafSpt 6jH6r/G876pig3jqJbVMBrN2kdrDuA1ooyMMENBnlNenR/90N8o43VWj4Zv6HkFSyoqk soFErp5DJ0czuKq3IZII11Lyxkpxq5wQFE+F9H5AUEOk3AUQPrOB4+SbpPGaELAbzcQb GPp97GsRLd07kFRFHLyiDJ4HDemUgJ6VR15+O4c953VtoZLs3DOJj4Kj9+/WtQruNhw8 LCJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=pqI8Vxqf; 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-44995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i10-20020a1709026aca00b001d4ede7ebf2si7548354plt.563.2024.01.30.08.56.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 08:56:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=pqI8Vxqf; 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-44995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44995-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 99710287F59 for ; Tue, 30 Jan 2024 16:55:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2C8812F5B1; 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="pqI8Vxqf" 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 4BC75129A87; Tue, 30 Jan 2024 16:53:12 +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=1706633594; cv=none; b=X3IFE9rfaYiN+tYXQWl+mXr3/L6xZpmoqif7dkLP8RjBcjSm3apYV5088VgZ8sEyhk4kZfa1IsPQmvLK1PbchVuRxjzyG3tB/uo4+f6WGLV+jsc7SnTZcj+XtM5+L5Fdc7ZwRyaBS45y/h3WeltMSfMipx+jGpwQF5G0WdiiGmI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706633594; c=relaxed/simple; bh=TeqAlXONUU5nqUDfGe4PPPm1rluqnLU8fKx0/5MP6+4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Wmb1QKayYTQitkR5w9ma60QSUn6PenVGQdXlrZyDDtUy7+6qkLFWIG10HSpdglKBifOzgwTM4CbRJ9aAXKqOR9uJFwQAjiyYkB1ciYfGxl8TiIZJ8Q+pB/ssb1eEIrvq2NzoiEfkv4cKBZLIipx3CNFYIQu8+gJ5e61X7eusv/A= 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=pqI8Vxqf; 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=TeqAlXONUU5nqUDfGe4PPPm1rluqnLU8fKx0/5MP6+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pqI8VxqfmApmjaDjKQX349yC1ZLj6cXG8NnjM6GRv0T0PqIXwhiwEPrza6mt1yGYj bPAMgS7faIoPvOFK2j2p8dbPw+IGautTYGnIeOJ8GcJ/S/4+3Tgn4lSKJxsLiC/5sG 4fvfrTpcL6JBjlv+dua8XbJsXqQyTP0mHbPrjpe3/oKtSxJQUFlSzrrBBSK3nUXR69 4Q7uQJi1R+AfVFW2LhIChPTjmyLDehNjjBOeS0GsHokH9TPg3wr/Lki3C6hyecKDio UYOhuErVYy275XFsBOAFeY8gqUTg1T9MkuzoJO0Owfc488XdmddiKhpHV0zLY4x73X JoaEMIwFP6lkA== 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 4TPWSc0vhmzVgK; Tue, 30 Jan 2024 11:53:04 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Vishal Verma , Dave Jiang Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Miklos Szeredi , linux-fsdevel@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 Subject: [RFC PATCH v2 5/8] fuse: Use dax_is_supported() Date: Tue, 30 Jan 2024 11:52:52 -0500 Message-Id: <20240130165255.212591-6-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. Silently 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: Miklos Szeredi Cc: linux-fsdevel@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 --- fs/fuse/dax.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c index 12ef91d170bb..36e1c1abbf8e 100644 --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -1336,6 +1336,13 @@ static bool fuse_should_enable_dax(struct inode *inode, unsigned int flags) if (dax_mode == FUSE_DAX_NEVER) return false; + /* + * Silently fallback to 'never' mode if the architecture does + * not support DAX. + */ + if (!dax_is_supported()) + return false; + /* * fc->dax may be NULL in 'inode' mode when filesystem device doesn't * support DAX, in which case it will silently fallback to 'never' mode. -- 2.39.2