diff mbox series

[RFC,v2,2/2] common: correct overlay+tmpfs cycle_mount

Message ID 20220507094524.949615-3-libaokun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series xfstests support overlay+tmpfs | expand

Commit Message

Baokun Li May 7, 2022, 9:45 a.m. UTC
overlay+tmpfs cycle_mount should be like tmpfs cycle_mount,
otherwise some test cases may have issue like "xxx: No such file or directory".

Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 common/rc | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

Comments

Zorro Lang May 9, 2022, 3:17 p.m. UTC | #1
On Sat, May 07, 2022 at 05:45:24PM +0800, Baokun Li wrote:
> overlay+tmpfs cycle_mount should be like tmpfs cycle_mount,
> otherwise some test cases may have issue like "xxx: No such file or directory".

If the 1st patch brings in an issue, then have to fix it in the 2nd patch,
I'd like to merge them into one completed patch. And these two patches are
not big, so it might be fine to do that and send again.

As Amir has given you some review points from overlayfs side, this part might
affect him more. So I'd like to wait a few days, if no reponse from him or
others, I'll give your patch my personal RVB, and merge it if test passed.

Thanks,
Zorro

> 
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
>  common/rc | 31 ++++++++++++++++++++++++-------
>  1 file changed, 24 insertions(+), 7 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 553ae350..ca465438 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -410,10 +410,19 @@ _scratch_cycle_mount()
>  {
>      local opts="$1"
>  
> -    if [ "$FSTYP" = tmpfs ]; then
> -	_scratch_remount "$opts"
> -	return
> -    fi
> +	case "$FSTYP" in
> +	tmpfs)
> +		_scratch_remount "$opts"
> +		return
> +		;;
> +	overlay)
> +		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
> +			_scratch_remount "$opts"
> +			return
> +		fi
> +		;;
> +	esac
> +
>      if test -n "$opts"; then
>  	opts="-o $opts"
>      fi
> @@ -522,9 +531,17 @@ _test_unmount()
>  
>  _test_cycle_mount()
>  {
> -    if [ "$FSTYP" = tmpfs ]; then
> -	return
> -    fi
> +	case "$FSTYP" in
> +	tmpfs)
> +		return
> +		;;
> +	overlay)
> +		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
> +			return
> +		fi
> +		;;
> +	esac
> +
>      _test_unmount
>      _test_mount
>  }
> -- 
> 2.31.1
>
Baokun Li May 10, 2022, 1:17 a.m. UTC | #2
在 2022/5/9 23:17, Zorro Lang 写道:
> On Sat, May 07, 2022 at 05:45:24PM +0800, Baokun Li wrote:
>> overlay+tmpfs cycle_mount should be like tmpfs cycle_mount,
>> otherwise some test cases may have issue like "xxx: No such file or directory".
> If the 1st patch brings in an issue, then have to fix it in the 2nd patch,
> I'd like to merge them into one completed patch. And these two patches are
> not big, so it might be fine to do that and send again.
>
> As Amir has given you some review points from overlayfs side, this part might
> affect him more. So I'd like to wait a few days, if no reponse from him or
> others, I'll give your patch my personal RVB, and merge it if test passed.
>
> Thanks,
> Zorro

I will send a patch V3 with the changes suggested by you. Thank you!

>> Signed-off-by: Baokun Li <libaokun1@huawei.com>
>> ---
>>   common/rc | 31 ++++++++++++++++++++++++-------
>>   1 file changed, 24 insertions(+), 7 deletions(-)
>>
>> diff --git a/common/rc b/common/rc
>> index 553ae350..ca465438 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -410,10 +410,19 @@ _scratch_cycle_mount()
>>   {
>>       local opts="$1"
>>   
>> -    if [ "$FSTYP" = tmpfs ]; then
>> -	_scratch_remount "$opts"
>> -	return
>> -    fi
>> +	case "$FSTYP" in
>> +	tmpfs)
>> +		_scratch_remount "$opts"
>> +		return
>> +		;;
>> +	overlay)
>> +		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
>> +			_scratch_remount "$opts"
>> +			return
>> +		fi
>> +		;;
>> +	esac
>> +
>>       if test -n "$opts"; then
>>   	opts="-o $opts"
>>       fi
>> @@ -522,9 +531,17 @@ _test_unmount()
>>   
>>   _test_cycle_mount()
>>   {
>> -    if [ "$FSTYP" = tmpfs ]; then
>> -	return
>> -    fi
>> +	case "$FSTYP" in
>> +	tmpfs)
>> +		return
>> +		;;
>> +	overlay)
>> +		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
>> +			return
>> +		fi
>> +		;;
>> +	esac
>> +
>>       _test_unmount
>>       _test_mount
>>   }
>> -- 
>> 2.31.1
>>
> .
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 553ae350..ca465438 100644
--- a/common/rc
+++ b/common/rc
@@ -410,10 +410,19 @@  _scratch_cycle_mount()
 {
     local opts="$1"
 
-    if [ "$FSTYP" = tmpfs ]; then
-	_scratch_remount "$opts"
-	return
-    fi
+	case "$FSTYP" in
+	tmpfs)
+		_scratch_remount "$opts"
+		return
+		;;
+	overlay)
+		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
+			_scratch_remount "$opts"
+			return
+		fi
+		;;
+	esac
+
     if test -n "$opts"; then
 	opts="-o $opts"
     fi
@@ -522,9 +531,17 @@  _test_unmount()
 
 _test_cycle_mount()
 {
-    if [ "$FSTYP" = tmpfs ]; then
-	return
-    fi
+	case "$FSTYP" in
+	tmpfs)
+		return
+		;;
+	overlay)
+		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
+			return
+		fi
+		;;
+	esac
+
     _test_unmount
     _test_mount
 }