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 <mathieu.desnoy...@efficios.com>
Cc: Chandan Babu R <chandan.b...@oracle.com>
Cc: Darrick J. Wong <djw...@kernel.org>
Cc: linux-...@vger.kernel.org
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: linux...@kvack.org
Cc: linux-a...@vger.kernel.org
Cc: Dan Williams <dan.j.willi...@intel.com>
Cc: Vishal Verma <vishal.l.ve...@intel.com>
Cc: Dave Jiang <dave.ji...@intel.com>
Cc: Matthew Wilcox <wi...@infradead.org>
Cc: Arnd Bergmann <a...@arndb.de>
Cc: Russell King <li...@armlinux.org.uk>
Cc: nvd...@lists.linux.dev
Cc: linux-...@vger.kernel.org
---
 fs/xfs/xfs_iops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index a0d77f5f512e..360f640159b0 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -1208,7 +1208,7 @@ static bool
 xfs_inode_should_enable_dax(
        struct xfs_inode *ip)
 {
-       if (!IS_ENABLED(CONFIG_FS_DAX))
+       if (!dax_is_supported())
                return false;
        if (xfs_has_dax_never(ip->i_mount))
                return false;
-- 
2.39.2


Reply via email to