fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH xfstests v2] overlay: Enable character device to be the base fs partition
@ 2019-09-25  1:54 Zhihao Cheng
  2019-09-25  3:05 ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Zhihao Cheng @ 2019-09-25  1:54 UTC (permalink / raw)
  To: guaneryu, amir73il, david.oberhollenzer, ebiggers, yi.zhang
  Cc: fstests, linux-kernel, chengzhihao1

There is a message in _supported_fs():
    _notrun "not suitable for this filesystem type: $FSTYP"
for when overlay usecases are executed on a chararcter device based base
fs. _overay_config_override() detects that the current base fs partition
is not a block device, and FSTYP won't be overwritten as 'overlay' before
executing usecases which results in all overlay usecases become 'notrun'.
In addition, all generic usecases are based on base fs rather than overlay.

We want to rewrite FSTYP to 'overlay' before running the usecases. To do
this, we need to add additional character device judgments for TEST_DEV
and SCRATCH_DEV in _overay_config_override().

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
---
 common/config | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/config b/common/config
index 4c86a49..a22acdb 100644
--- a/common/config
+++ b/common/config
@@ -550,7 +550,7 @@ _overlay_config_override()
 	#    the new OVL_BASE_SCRATCH/TEST_DEV/MNT vars are set to the values
 	#    of the configured base fs and SCRATCH/TEST_DEV vars are set to the
 	#    overlayfs base and mount dirs inside base fs mount.
-	[ -b "$TEST_DEV" ] || return 0
+	[ -b "$TEST_DEV" ] || [ -c "$TEST_DEV" ] || return 0
 
 	# Config file may specify base fs type, but we obay -overlay flag
 	[ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
@@ -570,7 +570,7 @@ _overlay_config_override()
 	export TEST_DIR="$OVL_BASE_TEST_DIR/$OVL_MNT"
 	export MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS"
 
-	[ -b "$SCRATCH_DEV" ] || return 0
+	[ -b "$SCRATCH_DEV" ] || [ -c "$SCRATCH_DEV" ] || return 0
 
 	# Store original base fs vars
 	export OVL_BASE_SCRATCH_DEV="$SCRATCH_DEV"
-- 
2.7.4

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

* Re: [PATCH xfstests v2] overlay: Enable character device to be the base fs partition
  2019-09-25  1:54 [PATCH xfstests v2] overlay: Enable character device to be the base fs partition Zhihao Cheng
@ 2019-09-25  3:05 ` Darrick J. Wong
  2019-09-25  3:17   ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2019-09-25  3:05 UTC (permalink / raw)
  To: Zhihao Cheng
  Cc: guaneryu, amir73il, david.oberhollenzer, ebiggers, yi.zhang,
	fstests, linux-kernel

On Wed, Sep 25, 2019 at 09:54:08AM +0800, Zhihao Cheng wrote:
> There is a message in _supported_fs():
>     _notrun "not suitable for this filesystem type: $FSTYP"
> for when overlay usecases are executed on a chararcter device based base

You can do that?

What does that even look like?

--D

> fs. _overay_config_override() detects that the current base fs partition
> is not a block device, and FSTYP won't be overwritten as 'overlay' before
> executing usecases which results in all overlay usecases become 'notrun'.
> In addition, all generic usecases are based on base fs rather than overlay.
> 
> We want to rewrite FSTYP to 'overlay' before running the usecases. To do
> this, we need to add additional character device judgments for TEST_DEV
> and SCRATCH_DEV in _overay_config_override().
> 
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> ---
>  common/config | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/config b/common/config
> index 4c86a49..a22acdb 100644
> --- a/common/config
> +++ b/common/config
> @@ -550,7 +550,7 @@ _overlay_config_override()
>  	#    the new OVL_BASE_SCRATCH/TEST_DEV/MNT vars are set to the values
>  	#    of the configured base fs and SCRATCH/TEST_DEV vars are set to the
>  	#    overlayfs base and mount dirs inside base fs mount.
> -	[ -b "$TEST_DEV" ] || return 0
> +	[ -b "$TEST_DEV" ] || [ -c "$TEST_DEV" ] || return 0
>  
>  	# Config file may specify base fs type, but we obay -overlay flag
>  	[ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
> @@ -570,7 +570,7 @@ _overlay_config_override()
>  	export TEST_DIR="$OVL_BASE_TEST_DIR/$OVL_MNT"
>  	export MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS"
>  
> -	[ -b "$SCRATCH_DEV" ] || return 0
> +	[ -b "$SCRATCH_DEV" ] || [ -c "$SCRATCH_DEV" ] || return 0
>  
>  	# Store original base fs vars
>  	export OVL_BASE_SCRATCH_DEV="$SCRATCH_DEV"
> -- 
> 2.7.4
> 

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

* Re: [PATCH xfstests v2] overlay: Enable character device to be the base fs partition
  2019-09-25  3:05 ` Darrick J. Wong
@ 2019-09-25  3:17   ` Darrick J. Wong
  2019-09-25  3:27     ` Zhihao Cheng
  0 siblings, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2019-09-25  3:17 UTC (permalink / raw)
  To: Zhihao Cheng
  Cc: guaneryu, amir73il, david.oberhollenzer, ebiggers, yi.zhang,
	fstests, linux-kernel

On Tue, Sep 24, 2019 at 08:05:50PM -0700, Darrick J. Wong wrote:
> On Wed, Sep 25, 2019 at 09:54:08AM +0800, Zhihao Cheng wrote:
> > There is a message in _supported_fs():
> >     _notrun "not suitable for this filesystem type: $FSTYP"
> > for when overlay usecases are executed on a chararcter device based base
> 
> You can do that?
> 
> What does that even look like?

OH, ubifs.  Ok.

/me wonders if there are more places in xfstests with test -b that needs
fixing...

--D

> --D
> 
> > fs. _overay_config_override() detects that the current base fs partition
> > is not a block device, and FSTYP won't be overwritten as 'overlay' before
> > executing usecases which results in all overlay usecases become 'notrun'.
> > In addition, all generic usecases are based on base fs rather than overlay.
> > 
> > We want to rewrite FSTYP to 'overlay' before running the usecases. To do
> > this, we need to add additional character device judgments for TEST_DEV
> > and SCRATCH_DEV in _overay_config_override().
> > 
> > Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> > ---
> >  common/config | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/common/config b/common/config
> > index 4c86a49..a22acdb 100644
> > --- a/common/config
> > +++ b/common/config
> > @@ -550,7 +550,7 @@ _overlay_config_override()
> >  	#    the new OVL_BASE_SCRATCH/TEST_DEV/MNT vars are set to the values
> >  	#    of the configured base fs and SCRATCH/TEST_DEV vars are set to the
> >  	#    overlayfs base and mount dirs inside base fs mount.
> > -	[ -b "$TEST_DEV" ] || return 0
> > +	[ -b "$TEST_DEV" ] || [ -c "$TEST_DEV" ] || return 0
> >  
> >  	# Config file may specify base fs type, but we obay -overlay flag
> >  	[ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
> > @@ -570,7 +570,7 @@ _overlay_config_override()
> >  	export TEST_DIR="$OVL_BASE_TEST_DIR/$OVL_MNT"
> >  	export MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS"
> >  
> > -	[ -b "$SCRATCH_DEV" ] || return 0
> > +	[ -b "$SCRATCH_DEV" ] || [ -c "$SCRATCH_DEV" ] || return 0
> >  
> >  	# Store original base fs vars
> >  	export OVL_BASE_SCRATCH_DEV="$SCRATCH_DEV"
> > -- 
> > 2.7.4
> > 

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

* Re: [PATCH xfstests v2] overlay: Enable character device to be the base fs partition
  2019-09-25  3:17   ` Darrick J. Wong
@ 2019-09-25  3:27     ` Zhihao Cheng
  2019-09-25  5:21       ` Amir Goldstein
  0 siblings, 1 reply; 5+ messages in thread
From: Zhihao Cheng @ 2019-09-25  3:27 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: guaneryu, amir73il, david.oberhollenzer, ebiggers, yi.zhang,
	fstests, linux-kernel

There are indeed many '-b' options in xfstests. I only confirmed the line of overlay test. Other -b test options I need to reconfirm later.

在 2019/9/25 11:17, Darrick J. Wong 写道:
> On Tue, Sep 24, 2019 at 08:05:50PM -0700, Darrick J. Wong wrote:
>> On Wed, Sep 25, 2019 at 09:54:08AM +0800, Zhihao Cheng wrote:
>>> There is a message in _supported_fs():
>>>     _notrun "not suitable for this filesystem type: $FSTYP"
>>> for when overlay usecases are executed on a chararcter device based base
>>
>> You can do that?
>>
>> What does that even look like?
> 
> OH, ubifs.  Ok.
> 
> /me wonders if there are more places in xfstests with test -b that needs
> fixing...
> 
> --D
> 
>> --D
>>
>>> fs. _overay_config_override() detects that the current base fs partition
>>> is not a block device, and FSTYP won't be overwritten as 'overlay' before
>>> executing usecases which results in all overlay usecases become 'notrun'.
>>> In addition, all generic usecases are based on base fs rather than overlay.
>>>
>>> We want to rewrite FSTYP to 'overlay' before running the usecases. To do
>>> this, we need to add additional character device judgments for TEST_DEV
>>> and SCRATCH_DEV in _overay_config_override().
>>>
>>> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
>>> ---
>>>  common/config | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/common/config b/common/config
>>> index 4c86a49..a22acdb 100644
>>> --- a/common/config
>>> +++ b/common/config
>>> @@ -550,7 +550,7 @@ _overlay_config_override()
>>>  	#    the new OVL_BASE_SCRATCH/TEST_DEV/MNT vars are set to the values
>>>  	#    of the configured base fs and SCRATCH/TEST_DEV vars are set to the
>>>  	#    overlayfs base and mount dirs inside base fs mount.
>>> -	[ -b "$TEST_DEV" ] || return 0
>>> +	[ -b "$TEST_DEV" ] || [ -c "$TEST_DEV" ] || return 0
>>>  
>>>  	# Config file may specify base fs type, but we obay -overlay flag
>>>  	[ "$FSTYP" == overlay ] || export OVL_BASE_FSTYP="$FSTYP"
>>> @@ -570,7 +570,7 @@ _overlay_config_override()
>>>  	export TEST_DIR="$OVL_BASE_TEST_DIR/$OVL_MNT"
>>>  	export MOUNT_OPTIONS="$OVERLAY_MOUNT_OPTIONS"
>>>  
>>> -	[ -b "$SCRATCH_DEV" ] || return 0
>>> +	[ -b "$SCRATCH_DEV" ] || [ -c "$SCRATCH_DEV" ] || return 0
>>>  
>>>  	# Store original base fs vars
>>>  	export OVL_BASE_SCRATCH_DEV="$SCRATCH_DEV"
>>> -- 
>>> 2.7.4
>>>
> 
> .
> 

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

* Re: [PATCH xfstests v2] overlay: Enable character device to be the base fs partition
  2019-09-25  3:27     ` Zhihao Cheng
@ 2019-09-25  5:21       ` Amir Goldstein
  0 siblings, 0 replies; 5+ messages in thread
From: Amir Goldstein @ 2019-09-25  5:21 UTC (permalink / raw)
  To: Zhihao Cheng
  Cc: Darrick J. Wong, Eryu Guan, David Oberhollenzer, Eric Biggers,
	zhangyi (F),
	fstests, linux-kernel

On Wed, Sep 25, 2019 at 6:27 AM Zhihao Cheng <chengzhihao1@huawei.com> wrote:
>
> There are indeed many '-b' options in xfstests. I only confirmed the line of overlay test. Other -b test options I need to reconfirm later.
>

FWIW, I eyeballed blockdev related overlayfs common code bits
and all I found out of order was:

@@ -3100,7 +3100,7 @@ _require_scratch_shutdown()
                        # SCRATCH_DEV, in this case OVL_BASE_SCRATCH_DEV
                        # will be null, so check OVL_BASE_SCRATCH_DEV before
                        # running shutdown to avoid shutting down base
fs accidently.
-                       _notrun "$SCRATCH_DEV is not a block device"
+                       _notrun "this test requires a valid
\$OVL_BASE_SCRATCH_DEV as ovl base fs"
                else
                        src/godown -f $OVL_BASE_SCRATCH_MNT 2>&1 \
                        || _notrun "Underlying filesystem does not
support shutdown"


Zhihaho,

That's all I meant in the nit.
The v1 commit message was perfectly fine, there was no need to change it at all.

Thanks,
Amir.

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

end of thread, other threads:[~2019-09-25  5:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25  1:54 [PATCH xfstests v2] overlay: Enable character device to be the base fs partition Zhihao Cheng
2019-09-25  3:05 ` Darrick J. Wong
2019-09-25  3:17   ` Darrick J. Wong
2019-09-25  3:27     ` Zhihao Cheng
2019-09-25  5:21       ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).