diff mbox series

[09/17] common: notrun in mkfs_dev for too small zoned file systems

Message ID 20250312064541.664334-10-hch@lst.de (mailing list archive)
State New
Headers show
Series [01/17] xfs/177: force a small file system size | expand

Commit Message

Christoph Hellwig March 12, 2025, 6:45 a.m. UTC
Similar to the regular scratch_mkfs, skip the test if the file system
would be so small that there's not enough zones.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 common/rc | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Darrick J. Wong March 12, 2025, 8:18 p.m. UTC | #1
On Wed, Mar 12, 2025 at 07:45:01AM +0100, Christoph Hellwig wrote:
> Similar to the regular scratch_mkfs, skip the test if the file system
> would be so small that there's not enough zones.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  common/rc | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 5e56d90e5931..e664f3b81a6b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -910,6 +910,10 @@ _mkfs_dev()
>  {
>      local tmp=`mktemp -u`
>      if ! _try_mkfs_dev "$@" 2>$tmp.mkfserr 1>$tmp.mkfsstd; then
> +	grep -q "must be greater than the minimum" $tmp.mkfserr && \

/methinks this also should look for the word "zone" somewhere so that it
doesn't trip on some other validation message for which we might want to
emit a different error.

--D

> +		_notrun "Zone count too small"
> +	grep -q "too small for zoned allocator" $tmp.mkfserr && \
> +		_notrun "Zone count too small"
>  	# output stored mkfs output
>  	cat $tmp.mkfserr >&2
>  	cat $tmp.mkfsstd
> -- 
> 2.45.2
> 
>
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 5e56d90e5931..e664f3b81a6b 100644
--- a/common/rc
+++ b/common/rc
@@ -910,6 +910,10 @@  _mkfs_dev()
 {
     local tmp=`mktemp -u`
     if ! _try_mkfs_dev "$@" 2>$tmp.mkfserr 1>$tmp.mkfsstd; then
+	grep -q "must be greater than the minimum" $tmp.mkfserr && \
+		_notrun "Zone count too small"
+	grep -q "too small for zoned allocator" $tmp.mkfserr && \
+		_notrun "Zone count too small"
 	# output stored mkfs output
 	cat $tmp.mkfserr >&2
 	cat $tmp.mkfsstd