fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] common/rc: don't clear superblock for zoned scratch pools
@ 2023-02-23 15:40 Johannes Thumshirn
  2023-02-23 17:01 ` Filipe Manana
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2023-02-23 15:40 UTC (permalink / raw)
  To: Zorro Lang; +Cc: linux-btrfs, fstests, Johannes Thumshirn

_require_scratch_dev_pool() zeros the first 100 sectors of each device to
clear eventual remains of older filesystems.

On zoned devices this creates all sorts of problems, so just skip the
clearing there.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 common/rc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index 654730b21ead..d763501be2b2 100644
--- a/common/rc
+++ b/common/rc
@@ -3461,7 +3461,9 @@ _require_scratch_dev_pool()
 		fi
 		# to help better debug when something fails, we remove
 		# traces of previous btrfs FS on the dev.
-		dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
+		if [ "`_zone_type "$i"`" = "none" ]; then
+			dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
+		fi
 	done
 }
 
-- 
2.39.1


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

* Re: [PATCH] common/rc: don't clear superblock for zoned scratch pools
  2023-02-23 15:40 [PATCH] common/rc: don't clear superblock for zoned scratch pools Johannes Thumshirn
@ 2023-02-23 17:01 ` Filipe Manana
  2023-02-24  9:25   ` Johannes Thumshirn
  2023-02-24  7:26 ` Naohiro Aota
  2023-02-24 13:40 ` Zorro Lang
  2 siblings, 1 reply; 6+ messages in thread
From: Filipe Manana @ 2023-02-23 17:01 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: Zorro Lang, linux-btrfs, fstests

On Thu, Feb 23, 2023 at 3:56 PM Johannes Thumshirn
<johannes.thumshirn@wdc.com> wrote:
>
> _require_scratch_dev_pool() zeros the first 100 sectors of each device to
> clear eventual remains of older filesystems.
>
> On zoned devices this creates all sorts of problems, so just skip the
> clearing there.

What kind of problems? Can you give 1 or 2 examples at least?
And it would be nice to comment in the code why we don't zero the
sectors for zoned devices.

Thanks.

>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  common/rc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/common/rc b/common/rc
> index 654730b21ead..d763501be2b2 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3461,7 +3461,9 @@ _require_scratch_dev_pool()
>                 fi
>                 # to help better debug when something fails, we remove
>                 # traces of previous btrfs FS on the dev.
> -               dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +               if [ "`_zone_type "$i"`" = "none" ]; then
> +                       dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +               fi
>         done
>  }
>
> --
> 2.39.1
>

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

* Re: [PATCH] common/rc: don't clear superblock for zoned scratch pools
  2023-02-23 15:40 [PATCH] common/rc: don't clear superblock for zoned scratch pools Johannes Thumshirn
  2023-02-23 17:01 ` Filipe Manana
@ 2023-02-24  7:26 ` Naohiro Aota
  2023-02-24  9:23   ` Johannes Thumshirn
  2023-02-24 13:40 ` Zorro Lang
  2 siblings, 1 reply; 6+ messages in thread
From: Naohiro Aota @ 2023-02-24  7:26 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: Zorro Lang, linux-btrfs, fstests

On Thu, Feb 23, 2023 at 07:40:35AM -0800, Johannes Thumshirn wrote:
> _require_scratch_dev_pool() zeros the first 100 sectors of each device to
> clear eventual remains of older filesystems.
> 
> On zoned devices this creates all sorts of problems, so just skip the
> clearing there.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  common/rc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 654730b21ead..d763501be2b2 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3461,7 +3461,9 @@ _require_scratch_dev_pool()
>  		fi
>  		# to help better debug when something fails, we remove
>  		# traces of previous btrfs FS on the dev.
> -		dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +		if [ "`_zone_type "$i"`" = "none" ]; then
> +			dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +		fi

How about resetting the first two zones on the zoned device case?

>  	done
>  }
>  
> -- 
> 2.39.1
> 

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

* Re: [PATCH] common/rc: don't clear superblock for zoned scratch pools
  2023-02-24  7:26 ` Naohiro Aota
@ 2023-02-24  9:23   ` Johannes Thumshirn
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2023-02-24  9:23 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: Zorro Lang, linux-btrfs, fstests

On 24.02.23 08:26, Naohiro Aota wrote:
> On Thu, Feb 23, 2023 at 07:40:35AM -0800, Johannes Thumshirn wrote:
>> _require_scratch_dev_pool() zeros the first 100 sectors of each device to
>> clear eventual remains of older filesystems.
>>
>> On zoned devices this creates all sorts of problems, so just skip the
>> clearing there.
>>
>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>> ---
>>  common/rc | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/rc b/common/rc
>> index 654730b21ead..d763501be2b2 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -3461,7 +3461,9 @@ _require_scratch_dev_pool()
>>  		fi
>>  		# to help better debug when something fails, we remove
>>  		# traces of previous btrfs FS on the dev.
>> -		dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
>> +		if [ "`_zone_type "$i"`" = "none" ]; then
>> +			dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
>> +		fi
> 
> How about resetting the first two zones on the zoned device case?
> 

yep that could work.


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

* Re: [PATCH] common/rc: don't clear superblock for zoned scratch pools
  2023-02-23 17:01 ` Filipe Manana
@ 2023-02-24  9:25   ` Johannes Thumshirn
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2023-02-24  9:25 UTC (permalink / raw)
  To: Filipe Manana; +Cc: Zorro Lang, linux-btrfs, fstests

On 23.02.23 18:02, Filipe Manana wrote:
>> On zoned devices this creates all sorts of problems, so just skip the
>> clearing there.
> What kind of problems? Can you give 1 or 2 examples at least?
> And it would be nice to comment in the code why we don't zero the
> sectors for zoned devices.

It will lead to unaligned write errors consequently failing subsequent
mkfs and failing every tests that has _require_scratch_dev_pool.

I'll add it to v2.

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

* Re: [PATCH] common/rc: don't clear superblock for zoned scratch pools
  2023-02-23 15:40 [PATCH] common/rc: don't clear superblock for zoned scratch pools Johannes Thumshirn
  2023-02-23 17:01 ` Filipe Manana
  2023-02-24  7:26 ` Naohiro Aota
@ 2023-02-24 13:40 ` Zorro Lang
  2 siblings, 0 replies; 6+ messages in thread
From: Zorro Lang @ 2023-02-24 13:40 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: linux-btrfs, fstests

On Thu, Feb 23, 2023 at 07:40:35AM -0800, Johannes Thumshirn wrote:
> _require_scratch_dev_pool() zeros the first 100 sectors of each device to
> clear eventual remains of older filesystems.
> 
> On zoned devices this creates all sorts of problems, so just skip the
> clearing there.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  common/rc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 654730b21ead..d763501be2b2 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3461,7 +3461,9 @@ _require_scratch_dev_pool()
>  		fi
>  		# to help better debug when something fails, we remove
>  		# traces of previous btrfs FS on the dev.
> -		dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +		if [ "`_zone_type "$i"`" = "none" ]; then
> +			dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +		fi

Better to add some comments to explain why we need to check
[ "`_zone_type "$i"`" = "none" ] at here, even if only copy
your git commit log at here.

>  	done
>  }
>  
> -- 
> 2.39.1
> 


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

end of thread, other threads:[~2023-02-24 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 15:40 [PATCH] common/rc: don't clear superblock for zoned scratch pools Johannes Thumshirn
2023-02-23 17:01 ` Filipe Manana
2023-02-24  9:25   ` Johannes Thumshirn
2023-02-24  7:26 ` Naohiro Aota
2023-02-24  9:23   ` Johannes Thumshirn
2023-02-24 13:40 ` Zorro Lang

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).