Linux Overlay Filesystem development
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	linux-unionfs@vger.kernel.org,  fstests@vger.kernel.org,
	Prabhakar Pujeri <prabhakar.pujeri@dell.com>
Subject: Re: [PATCH] common/overlay: fix _check_overlay_feature for default-on param-less options
Date: Sun, 22 Nov 2026 01:19:19 +0800	[thread overview]
Message-ID: <awHSXIxDUNu2kacw@zlang-mailbox> (raw)
In-Reply-To: <20261106155832.3867017-1-amir73il@gmail.com>

On Fri, Nov 06, 2026 at 04:58:31PM +0100, Amir Goldstein wrote:
> Overlayfs only displays a mount option if it differs from the default.
> Commit 73a018cb treated a feature without a module parameter of the same
> name (e.g. xino) as default off and required "${feature}=on" in the mount
> options.  On a samefs xfs setup xino is on by default and is not displayed,
> so tests requiring xino (e.g. overlay/041, 043, 044, 067, 070, 071) were
> wrongly skipped.
> 
> For features without a boolean module parameter, assume the feature may
> be on by default and only verify that the mount options do not show it
> with a value other than "on", same as for features that default to Y.
> 
> Fixes: 73a018cbf57b ("common/overlay: let _check_overlay_feature handle param-less options")
> Cc: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---

Looks good to me!

Reviewed-by: Zorro Lang <zlang@kernel.org>

>  common/overlay | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/common/overlay b/common/overlay
> index 132b2bf7..0cf6db2d 100644
> --- a/common/overlay
> +++ b/common/overlay
> @@ -172,24 +172,20 @@ _check_overlay_feature()
>  	# parameter (the system default) and per mount by mount
>  	# option ${feature}=[on|off].
>  	local default=`_get_fs_module_param ${feature}`
> -	if [ "$default" != Y ] && [ "$default" != N ]; then
> -		# Some mount options (e.g. uuid, xino, verity) have no
> -		# on/off module parameter of the same name.  For those,
> -		# a missing (or non-boolean) parameter means that the
> -		# feature defaults to off rather than that it is
> -		# unsupported.  Unsupported options are rejected by the
> -		# probe mount in _require_scratch_overlay_features.
> -		default=N
> -	fi
> +	local value=`_fs_options $dev | tr ',' '\n' | grep "^${feature}=" | cut -d= -f2`
>
>  	# Check options to be sure. For example, Overlayfs will fallback to
>  	# index=off if underlying fs does not support file handles.
>  	# Overlayfs only displays mount option if it differs from the default.
> +	# Without a module param of the same name (e.g. xino), the feature
> +	# may be on by default, so only require it is not shown as non-on.
>  	# Overlayfs may enable the feature, but fallback to read-only mount.
> -	((( [ "$default" = N ] && _fs_options $dev | grep -q "${feature}=on" ) || \
> -	  ( [ "$default" = Y ] && ! _fs_options $dev | grep -q "${feature}=off" )) && \
> -	    touch $mnt/foo 2>/dev/null ) || \
> -	        _notrun "${FSTYP} feature '${feature}' cannot be enabled on ${dev}"
> +	if [ "$default" = N ]; then
> +		[ "$value" = on ]
> +	else
> +		[ -z "$value" -o "$value" = on ]
> +	fi && touch $mnt/foo 2>/dev/null || \
> +		_notrun "${FSTYP} feature '${feature}' cannot be enabled on ${dev}"
>  }
>  
>  # Require a set of overlayfs features
> -- 
> 2.55.0
> 

      reply	other threads:[~2026-11-21 17:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 15:58 [PATCH] common/overlay: fix _check_overlay_feature for default-on param-less options Amir Goldstein
2026-11-21 17:19 ` Zorro Lang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=awHSXIxDUNu2kacw@zlang-mailbox \
    --to=zlang@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=prabhakar.pujeri@dell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox