All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] overlay: avoid to use NULL OVL_BASE_FSTYP for mounting
@ 2022-12-29 13:44 Baokun Li
  2023-01-01 13:29 ` Zorro Lang
  2023-01-04  0:33 ` Murphy Zhou
  0 siblings, 2 replies; 3+ messages in thread
From: Baokun Li @ 2022-12-29 13:44 UTC (permalink / raw)
  To: fstests
  Cc: zlang, guaneryu, amir73il, jencce.kernel, hsiangkao, libaokun1,
	yi.zhang, yukuai3

Generally, FSTYP is used to specify OVL_BASE_FSTYP. When we specify FSTYP
through an environment variable, it is not converted to OVL_BASE_FSTYP.
In addition, sometimes we do not even specify the file type. For example,
we only use `./check -n -overlay -g auto` to list overlay-related cases.
If OVL_BASE_FSTYP is NULL, mounting fails and the test fails.

To solve this problem, try to assign a value to OVL_BASE_FSTYP when
specifying -overlay. In addition, in the _overlay_base_mount function,
the basic file system type of the overlay is specified only when
OVL_BASE_FSTYP is not NULL.

Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 check          | 1 +
 common/overlay | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/check b/check
index 1ff0f44a..22062935 100755
--- a/check
+++ b/check
@@ -283,6 +283,7 @@ while [ $# -gt 0 ]; do
 		FSTYP="${1:1}"
 		;;
 	-overlay)
+		[ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
 		FSTYP=overlay
 		export OVERLAY=true
 		;;
diff --git a/common/overlay b/common/overlay
index e35419d0..20cafeb1 100644
--- a/common/overlay
+++ b/common/overlay
@@ -85,7 +85,12 @@ _overlay_base_mount()
 		return 1
 	fi
 
-	_mount -t $OVL_BASE_FSTYP $* $dev $mnt
+	if [ $OVL_BASE_FSTYP ]; then
+		_mount -t $OVL_BASE_FSTYP $* $dev $mnt
+	else
+		_mount $* $dev $mnt
+	fi
+
 	_idmapped_mount $dev $mnt
 }
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] overlay: avoid to use NULL OVL_BASE_FSTYP for mounting
  2022-12-29 13:44 [PATCH] overlay: avoid to use NULL OVL_BASE_FSTYP for mounting Baokun Li
@ 2023-01-01 13:29 ` Zorro Lang
  2023-01-04  0:33 ` Murphy Zhou
  1 sibling, 0 replies; 3+ messages in thread
From: Zorro Lang @ 2023-01-01 13:29 UTC (permalink / raw)
  To: xzhou; +Cc: fstests

On Thu, Dec 29, 2022 at 09:44:34PM +0800, Baokun Li wrote:
> Generally, FSTYP is used to specify OVL_BASE_FSTYP. When we specify FSTYP
> through an environment variable, it is not converted to OVL_BASE_FSTYP.
> In addition, sometimes we do not even specify the file type. For example,
> we only use `./check -n -overlay -g auto` to list overlay-related cases.
> If OVL_BASE_FSTYP is NULL, mounting fails and the test fails.
> 
> To solve this problem, try to assign a value to OVL_BASE_FSTYP when
> specifying -overlay. In addition, in the _overlay_base_mount function,
> the basic file system type of the overlay is specified only when
> OVL_BASE_FSTYP is not NULL.
> 
> Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---

Hi Murphy,

Does this patch fix the problem you hit?

Thanks,
Zorro

>  check          | 1 +
>  common/overlay | 7 ++++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/check b/check
> index 1ff0f44a..22062935 100755
> --- a/check
> +++ b/check
> @@ -283,6 +283,7 @@ while [ $# -gt 0 ]; do
>  		FSTYP="${1:1}"
>  		;;
>  	-overlay)
> +		[ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
>  		FSTYP=overlay
>  		export OVERLAY=true
>  		;;
> diff --git a/common/overlay b/common/overlay
> index e35419d0..20cafeb1 100644
> --- a/common/overlay
> +++ b/common/overlay
> @@ -85,7 +85,12 @@ _overlay_base_mount()
>  		return 1
>  	fi
>  
> -	_mount -t $OVL_BASE_FSTYP $* $dev $mnt
> +	if [ $OVL_BASE_FSTYP ]; then
> +		_mount -t $OVL_BASE_FSTYP $* $dev $mnt
> +	else
> +		_mount $* $dev $mnt
> +	fi
> +
>  	_idmapped_mount $dev $mnt
>  }
>  
> -- 
> 2.31.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] overlay: avoid to use NULL OVL_BASE_FSTYP for mounting
  2022-12-29 13:44 [PATCH] overlay: avoid to use NULL OVL_BASE_FSTYP for mounting Baokun Li
  2023-01-01 13:29 ` Zorro Lang
@ 2023-01-04  0:33 ` Murphy Zhou
  1 sibling, 0 replies; 3+ messages in thread
From: Murphy Zhou @ 2023-01-04  0:33 UTC (permalink / raw)
  To: Baokun Li
  Cc: fstests, zlang, guaneryu, amir73il, hsiangkao, yi.zhang, yukuai3

Thanks! This fixed my original issue.

On Thu, Dec 29, 2022 at 9:24 PM Baokun Li <libaokun1@huawei.com> wrote:
>
> Generally, FSTYP is used to specify OVL_BASE_FSTYP. When we specify FSTYP
> through an environment variable, it is not converted to OVL_BASE_FSTYP.
> In addition, sometimes we do not even specify the file type. For example,
> we only use `./check -n -overlay -g auto` to list overlay-related cases.
> If OVL_BASE_FSTYP is NULL, mounting fails and the test fails.
>
> To solve this problem, try to assign a value to OVL_BASE_FSTYP when
> specifying -overlay. In addition, in the _overlay_base_mount function,
> the basic file system type of the overlay is specified only when
> OVL_BASE_FSTYP is not NULL.
>
> Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
>  check          | 1 +
>  common/overlay | 7 ++++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/check b/check
> index 1ff0f44a..22062935 100755
> --- a/check
> +++ b/check
> @@ -283,6 +283,7 @@ while [ $# -gt 0 ]; do
>                 FSTYP="${1:1}"
>                 ;;
>         -overlay)
> +               [ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
>                 FSTYP=overlay
>                 export OVERLAY=true
>                 ;;
> diff --git a/common/overlay b/common/overlay
> index e35419d0..20cafeb1 100644
> --- a/common/overlay
> +++ b/common/overlay
> @@ -85,7 +85,12 @@ _overlay_base_mount()
>                 return 1
>         fi
>
> -       _mount -t $OVL_BASE_FSTYP $* $dev $mnt
> +       if [ $OVL_BASE_FSTYP ]; then
> +               _mount -t $OVL_BASE_FSTYP $* $dev $mnt
> +       else
> +               _mount $* $dev $mnt
> +       fi
> +
>         _idmapped_mount $dev $mnt
>  }
>
> --
> 2.31.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-04  0:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-29 13:44 [PATCH] overlay: avoid to use NULL OVL_BASE_FSTYP for mounting Baokun Li
2023-01-01 13:29 ` Zorro Lang
2023-01-04  0:33 ` Murphy Zhou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.