Received: by 2002:a05:6500:4c4:b0:1ed:114f:4c4b with SMTP id y4csp16966lqc; Thu, 29 Feb 2024 08:32:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVWUafOw1f+ctOhdsPPXYLGiIC0oEb56fXNPa/OdRG7emOHPMPc/Lv7YmbIII/PwkB3t2t+ZAUnotEjD+kMOY4PUhEc1LJwpYl+gdVQMw== X-Google-Smtp-Source: AGHT+IEZ0Ate8aux7mfXs1oSn4ZCu5w7Mfy/8hEuZGN5KwFKdRNqUBLpjwAVb4FUo5vHhBi7wtvR X-Received: by 2002:a05:6870:231b:b0:21f:3c38:3839 with SMTP id w27-20020a056870231b00b0021f3c383839mr2526490oao.58.1709224361467; Thu, 29 Feb 2024 08:32:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709224361; cv=pass; d=google.com; s=arc-20160816; b=nSTTEGbvmvVPE8ZxrwB1z5NN7PyLngGdevbQyt3BDE8u6eVw9y7FAldmX+PUbulXbT a9PTZDYwGZpKOmsIS7EtCjJN6jhqY64gzS4bLKHtWElsybINvEE8Jzym0MJOcfmBjl+1 KM1IDoechAGvPjwqjn6M+YayjbaULQoP3N8wWVplyKD1+9j/1iBzfZbZ+okQZXCsd7uQ F6GSlz1KVdBrCGuINIYFjszGqFLR3KBAac0EpmDGhY0fBJ8+aqsQ9U420Kp+32JD4EBR 2Mb6vqPZeCQSpgEOw66RbJ4hR5RDFusaB7Oe6A/9YYFGJ16M24fS5kmOyf8/qvR3ntXW 13yA== 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; bh=GzDIoIzg2qxCxOoijDvz5f8DbHu2S6EY+M5uaRRkgWg=; fh=jGdaoZ9f8fxaZ4S3XMcGs4Y5Dr6Ro1lg3HBgLAvBHb8=; b=ZpgI+uP91ZCIuu1oy3Amn410acZfythfL6vg+SlvIWVHgFiiLCqsmqsCdzrTp60E1h a7KGjmoIeZx5rgjglBm0EHc4HWikRHrR2YjfTgMkKGQryKNBlMq1AXKSUgzSMc+XsZuZ vZZfDY3Uual/NZ+Yy7ElMGYrb8csXQGSAJtJbd64jvWyKKTmJtx1S7hTEw26UDQfKy+z cp3cDxqWoUq2YMKsrSWWayHNssuPaJX0z8wbM7APAj1TkiyKSX/PbGWuDdcFeFVl44mh GggOFNBPrl1KeoaDaflHXnJ7+yJzKHEeE2cQfxOgOExfQq0H1St55k3Ek585r551S/16 Zj2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z16-20020a056102067000b0046d62309a13si228027vsf.573.2024.02.29.08.32.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 08:32:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-ext4+bounces-1438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 228871C23597 for ; Thu, 29 Feb 2024 16:32:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE05167E64; Thu, 29 Feb 2024 16:30:19 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD41663B9; Thu, 29 Feb 2024 16:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709224219; cv=none; b=J9LAZXBiqWpmHfiXOdGz9P4WjMjUnniMyWa1x94z9PDBSck8HyKkIZR+UM0VFIsieHo0liDjUAqAWxhwLWrrS5AvBYteghLKifXCP1L7eZzKnhWaY8nKEMHOXla/DHnqExbsiXvgKIDPb4VE0ujOrwN91S4pB+EkWsMIh4tSu4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709224219; c=relaxed/simple; bh=Xk9XcUV/m/3qcxL2T7wAJKSjMepPVZ/pH5SeAdJs0Ps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bze0lyIMrz2HfK5K/SP8NxAoMjq0TeCiXtmbDWtKvYytYgmuUB3XZ8dLZGF7nIdjVOjL3kl4eBmQAiov3TPdOOTyBR6t6H/e8O+WKLm4nJqn4CKaNfUYu853odRD48/saBgpETPnxY83syKC31IpcDCIfjqB6c2txjX3OrS+Dg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E036C21FD4; Thu, 29 Feb 2024 16:30:15 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2150613A8B; Thu, 29 Feb 2024 16:30:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id wNTjBBex4GU0PwAAD6G6ig (envelope-from ); Thu, 29 Feb 2024 16:30:15 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id aac9d32e; Thu, 29 Feb 2024 16:30:14 +0000 (UTC) From: Luis Henriques To: Theodore Ts'o , Andreas Dilger , Alexander Viro , Christian Brauner , Jan Kara , Miklos Szeredi , Amir Goldstein Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Henriques Subject: [PATCH 1/3] fs_parser: handle parameters that can be empty and don't have a value Date: Thu, 29 Feb 2024 16:30:08 +0000 Message-ID: <20240229163011.16248-2-lhenriques@suse.de> In-Reply-To: <20240229163011.16248-1-lhenriques@suse.de> References: <20240229163011.16248-1-lhenriques@suse.de> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: E036C21FD4 X-Spam-Flag: NO Currently, only parameters that have the fs_parameter_spec 'type' set to NULL are handled as 'flag' types. However, parameters that have the 'fs_param_can_be_empty' flag set and their value is NULL should also be handled as 'flag' type, as their type is set to 'fs_value_is_flag'. Signed-off-by: Luis Henriques --- fs/fs_parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fs_parser.c b/fs/fs_parser.c index edb3712dcfa5..53f6cb98a3e0 100644 --- a/fs/fs_parser.c +++ b/fs/fs_parser.c @@ -119,7 +119,8 @@ int __fs_parse(struct p_log *log, /* Try to turn the type we were given into the type desired by the * parameter and give an error if we can't. */ - if (is_flag(p)) { + if (is_flag(p) || + (!param->string && (p->flags & fs_param_can_be_empty))) { if (param->type != fs_value_is_flag) return inval_plog(log, "Unexpected value for '%s'", param->key);