Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp634482rdb; Mon, 29 Jan 2024 13:07:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGL70ZwyXH8oFVWcNiFsNkcK80I71oAzhszcXFr++a9bsCKxqLu5nlB0vTdg4D2E8G/3w5O X-Received: by 2002:aa7:d688:0:b0:55e:fead:a46f with SMTP id d8-20020aa7d688000000b0055efeada46fmr3291874edr.12.1706562459067; Mon, 29 Jan 2024 13:07:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706562459; cv=pass; d=google.com; s=arc-20160816; b=aOOD6yNfJ7IhnaDTmG0ocrtKZLtPYVxXNzVfO2ezIyYE3DApRHUXXiEvoS+bAIxTlx VtnMhXo1ZJIFf1UMirXbDkow9V8oRrDuFcDN86MqATPFn79slu16RCe88o90blepTSgM vTioAdK9oW264AaRgpsq225U278/isnxg9jKq2Zydeiypnz3qkH+z9+lEigVGS8aIUyQ OCyr2/aHzwNrQDr1Aj6J0J44sQfEMqn+/HO/1BDvU8lTWypxw4J5zFXaJ0M99rpm6/EE 7EKSC3WUcTBkZZZCepQzkzelKkL+Eu+aza86qpucRE0a2hzCSvtnh75BD24AhzgUBVif 7odQ== 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=mfWIaSpCcPWqZBxniokIPkYJb2xdS5Fuw1IXd4cGGKg=; fh=CnG4FQZauYwsz1LYew28BcNgjFRWgEP0GK0xWRZJKJI=; b=mpB05u9stCoaH50pshmcOwZw3k6u3yAyqd5pF/zG5ZTIYAyPnzngh3DPi8Bv0N6xcn NelSzvc1g8hG9g24IfISCNZfX+f40gVy8n8UVzy3CpWozSE1sUdFvJ4vaO1ZZoWnV5mk NygIfOLAfhqMVX1wnqQhfPCDBJlQitBxjtOQY+BYf8EQksEhSWQUFbTgXTING+h7fXZI B8DOVg2rgJXc5xFZrugJP2Qp76wpYh3PmYeFLXQ6akYnABWmXcgyhLdL9GYIZ/MCk6mZ xMmrPRW2sI84L1iVLPREhPzw1OQxOqZa4RaDTbj82+09ZHdi1cZpCqd8XgR3dbbuPW3V 0BSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=owLk9BdI; 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-43503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n17-20020aa7c691000000b0055f0531c62asi1160412edq.174.2024.01.29.13.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 13:07:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=owLk9BdI; 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-43503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43503-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BDB3E1F259EC for ; Mon, 29 Jan 2024 21:07:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCB9E15A485; Mon, 29 Jan 2024 21:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="owLk9BdI" 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 7414E157E6B; Mon, 29 Jan 2024 21:06:51 +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=1706562414; cv=none; b=MS04Od4uN/RQDvvWyXSiiqfCY76L9IAy4Hvrag4buao6piROzQjDpR+4ZwihgwrbmZAm/K0KBGBk2z42jXCytSmLkgm0zmrMrmUlt1gUdNLVmf6z1mGHA0q8nT0fUxt52J1JOiSzrZG3XrL01yOYHWQbFv0AyzIwHJ8SjCgb8Yk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706562414; c=relaxed/simple; bh=/LtPwfaY3uvi/uQueiJk5XQ5+25aOGLyhq5zZA6ahe8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j4LQ1rgd+V9cv+w2y4ZjJV2BGML+eS+PH4/5ihGAozRF7aYM0Wntlqe7lnNpIfBsTxpN4cZq973EvohnDGshOkYYNgUUfs7EpWnQXQ0c5r8wj8cu1oLoQjqNyxbxP5YvTrHuZJsyC3+gZAAbBu+HuoIBFiL9IjwP/TmmRP3sv60= 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=owLk9BdI; 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=1706562410; bh=/LtPwfaY3uvi/uQueiJk5XQ5+25aOGLyhq5zZA6ahe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=owLk9BdIvYMqzPMeQbF2d7yNSH3zTkRUuREg1aXHoA5/oKPsRDPqPidgGmIGg+ZMe uDiNO1/hYtcLl6AbcYMjONTAvJEsm6nwxQqyLcdJ/rEInjNK7h/7xuu18NXQG94k5M nDpyHDrTa9Es9c9pzOQ+TFHsELADk92a4djW5vooUTinmDn2l9YfYZTRGedTlpDb1b MI3xshUjIJfHBa1pLt/SmgLF6goBo2TIOsc/su8NScSwzwbLdoBVSgvIlqpOTOOubM FokMDNIjPddKGnlVW51N6DyLGp3GD1P7ThIgTTI/7EBNQcDz6UZ9lqZkBEx0WblNU7 uTSeb4zKuNrPw== 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 4TP17t029YzVXW; Mon, 29 Jan 2024 16:06:49 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Vishal Verma , Dave Jiang Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , linux-erofs@lists.ozlabs.org, Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arch@vger.kernel.org, Matthew Wilcox , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org Subject: [RFC PATCH 3/7] erofs: Use dax_is_supported() Date: Mon, 29 Jan 2024 16:06:27 -0500 Message-Id: <20240129210631.193493-4-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129210631.193493-1-mathieu.desnoyers@efficios.com> References: <20240129210631.193493-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. This is relevant for architectures which require a dynamic check to validate whether they have virtually aliased data caches (ARCH_HAS_CACHE_ALIASING_DYNAMIC=y). Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Gao Xiang Cc: Chao Yu Cc: Yue Hu Cc: Jeffle Xu Cc: linux-erofs@lists.ozlabs.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: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org --- fs/erofs/super.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 3789d6224513..bd88221f1ad7 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -419,9 +419,13 @@ static const struct fs_parameter_spec erofs_fs_parameters[] = { static bool erofs_fc_set_dax_mode(struct fs_context *fc, unsigned int mode) { -#ifdef CONFIG_FS_DAX struct erofs_fs_context *ctx = fc->fs_private; + if (!dax_is_supported()) { + errorfc(fc, "dax options not supported"); + return false; + } + switch (mode) { case EROFS_MOUNT_DAX_ALWAYS: warnfc(fc, "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); @@ -436,10 +440,6 @@ static bool erofs_fc_set_dax_mode(struct fs_context *fc, unsigned int mode) DBG_BUGON(1); return false; } -#else - errorfc(fc, "dax options not supported"); - return false; -#endif } static int erofs_fc_parse_param(struct fs_context *fc, -- 2.39.2