diff mbox series

[1/2] common/config: export TEST_DEV for mkfs.xfs

Message ID 20240411063234.30110-1-ddiss@suse.de (mailing list archive)
State New, archived
Headers show
Series [1/2] common/config: export TEST_DEV for mkfs.xfs | expand

Commit Message

David Disseldorp April 11, 2024, 6:32 a.m. UTC
As of xfsprogs commit 6e0ed3d1 ("mkfs: stop allowing tiny filesystems")
attempts to create XFS filesystems sized under 300M fail, unless
TEST_DIR, TEST_DEV and QA_CHECK_FS environment variables are exported
(or a --unsupported mkfs parameter is provided).

TEST_DIR and QA_CHECK_FS are already exported, while TEST_DEV may only
be locally set if provided via e.g. configs/$HOSTNAME.config. Explicitly
export TEST_DEV to ensure that tests which call _scratch_mkfs_sized()
with an fssize under 300M run normally.

Signed-off-by: David Disseldorp <ddiss@suse.de>
---
 common/config | 3 +++
 1 file changed, 3 insertions(+)

Comments

Darrick J. Wong April 12, 2024, 3:44 p.m. UTC | #1
On Thu, Apr 11, 2024 at 04:32:33PM +1000, David Disseldorp wrote:
> As of xfsprogs commit 6e0ed3d1 ("mkfs: stop allowing tiny filesystems")
> attempts to create XFS filesystems sized under 300M fail, unless
> TEST_DIR, TEST_DEV and QA_CHECK_FS environment variables are exported
> (or a --unsupported mkfs parameter is provided).
> 
> TEST_DIR and QA_CHECK_FS are already exported, while TEST_DEV may only
> be locally set if provided via e.g. configs/$HOSTNAME.config. Explicitly
> export TEST_DEV to ensure that tests which call _scratch_mkfs_sized()
> with an fssize under 300M run normally.
> 
> Signed-off-by: David Disseldorp <ddiss@suse.de>
> ---
>  common/config | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/config b/common/config
> index 2a1434bb..4bd5650f 100644
> --- a/common/config
> +++ b/common/config
> @@ -932,6 +932,9 @@ else
>  fi
>  
>  _canonicalize_devices
> +# mkfs.xfs checks for TEST_DEV before permitting < 300M filesystems. TEST_DIR
> +# and QA_CHECK_FS are also checked by mkfs.xfs, but already exported elsewhere.
> +export TEST_DEV

I wonder if we only ought to do this for $FSTYP = xfs, but I don't have
a problem with this so

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

>  
>  # make sure this script returns success
>  /bin/true
> -- 
> 2.35.3
> 
>
hch@infradead.org April 27, 2024, 5:56 a.m. UTC | #2
On Thu, Apr 11, 2024 at 04:32:33PM +1000, David Disseldorp wrote:
> As of xfsprogs commit 6e0ed3d1 ("mkfs: stop allowing tiny filesystems")
> attempts to create XFS filesystems sized under 300M fail, unless
> TEST_DIR, TEST_DEV and QA_CHECK_FS environment variables are exported
> (or a --unsupported mkfs parameter is provided).
> 
> TEST_DIR and QA_CHECK_FS are already exported, while TEST_DEV may only
> be locally set if provided via e.g. configs/$HOSTNAME.config. Explicitly
> export TEST_DEV to ensure that tests which call _scratch_mkfs_sized()
> with an fssize under 300M run normally.

As for fixing the immediate problem this looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>

But adding the xfs list as allowing to create a smaller than supported
file system just for testing is pretty silly.  If we don't want to
support these tiny file systems, we should also not use them for
testing.  The best way to port over the existing tests to a larger
size would probably be to round up the size to the minimum supported
one and then fill the space?
Zorro Lang April 28, 2024, 5:37 a.m. UTC | #3
On Thu, Apr 11, 2024 at 04:32:33PM +1000, David Disseldorp wrote:
> As of xfsprogs commit 6e0ed3d1 ("mkfs: stop allowing tiny filesystems")
> attempts to create XFS filesystems sized under 300M fail, unless
> TEST_DIR, TEST_DEV and QA_CHECK_FS environment variables are exported
> (or a --unsupported mkfs parameter is provided).
> 
> TEST_DIR and QA_CHECK_FS are already exported, while TEST_DEV may only
> be locally set if provided via e.g. configs/$HOSTNAME.config. Explicitly
> export TEST_DEV to ensure that tests which call _scratch_mkfs_sized()
> with an fssize under 300M run normally.
> 
> Signed-off-by: David Disseldorp <ddiss@suse.de>
> ---

Actually, using "export" in xfstests/local.config for each parameter could
help too.

The 2nd patch still has some disagreement, I'll merge this patch at first,
as it's simple enough and got two RVBs.

Thanks,
Zorro

>  common/config | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/config b/common/config
> index 2a1434bb..4bd5650f 100644
> --- a/common/config
> +++ b/common/config
> @@ -932,6 +932,9 @@ else
>  fi
>  
>  _canonicalize_devices
> +# mkfs.xfs checks for TEST_DEV before permitting < 300M filesystems. TEST_DIR
> +# and QA_CHECK_FS are also checked by mkfs.xfs, but already exported elsewhere.
> +export TEST_DEV
>  
>  # make sure this script returns success
>  /bin/true
> -- 
> 2.35.3
> 
>
David Disseldorp April 29, 2024, 11:28 a.m. UTC | #4
On Sun, 28 Apr 2024 13:37:17 +0800, Zorro Lang wrote:

> On Thu, Apr 11, 2024 at 04:32:33PM +1000, David Disseldorp wrote:
> > As of xfsprogs commit 6e0ed3d1 ("mkfs: stop allowing tiny filesystems")
> > attempts to create XFS filesystems sized under 300M fail, unless
> > TEST_DIR, TEST_DEV and QA_CHECK_FS environment variables are exported
> > (or a --unsupported mkfs parameter is provided).
> > 
> > TEST_DIR and QA_CHECK_FS are already exported, while TEST_DEV may only
> > be locally set if provided via e.g. configs/$HOSTNAME.config. Explicitly
> > export TEST_DEV to ensure that tests which call _scratch_mkfs_sized()
> > with an fssize under 300M run normally.
> > 
> > Signed-off-by: David Disseldorp <ddiss@suse.de>
> > ---  
> 
> Actually, using "export" in xfstests/local.config for each parameter could
> help too.
> 
> The 2nd patch still has some disagreement, I'll merge this patch at first,
> as it's simple enough and got two RVBs.

Thanks. I'll send an updated 2/2 today following Darrick's suggestion of
_try_scratch_mkfs_sized $* || _fail
Zorro Lang April 29, 2024, 1:37 p.m. UTC | #5
On Mon, Apr 29, 2024 at 09:28:45PM +1000, David Disseldorp wrote:
> On Sun, 28 Apr 2024 13:37:17 +0800, Zorro Lang wrote:
> 
> > On Thu, Apr 11, 2024 at 04:32:33PM +1000, David Disseldorp wrote:
> > > As of xfsprogs commit 6e0ed3d1 ("mkfs: stop allowing tiny filesystems")
> > > attempts to create XFS filesystems sized under 300M fail, unless
> > > TEST_DIR, TEST_DEV and QA_CHECK_FS environment variables are exported
> > > (or a --unsupported mkfs parameter is provided).
> > > 
> > > TEST_DIR and QA_CHECK_FS are already exported, while TEST_DEV may only
> > > be locally set if provided via e.g. configs/$HOSTNAME.config. Explicitly
> > > export TEST_DEV to ensure that tests which call _scratch_mkfs_sized()
> > > with an fssize under 300M run normally.
> > > 
> > > Signed-off-by: David Disseldorp <ddiss@suse.de>
> > > ---  
> > 
> > Actually, using "export" in xfstests/local.config for each parameter could
> > help too.
> > 
> > The 2nd patch still has some disagreement, I'll merge this patch at first,
> > as it's simple enough and got two RVBs.
> 
> Thanks. I'll send an updated 2/2 today following Darrick's suggestion of
> _try_scratch_mkfs_sized $* || _fail

Thanks for doing it :)

I'm wondering if we could change all _scratch_mkfs and _scratch_mkfs_xxx helpers
like that. But we can change _scratch_mkfs_sized at first, then other _scratch_mkfs_xxx
helpers, then _scratch_mkfs itself.

At the same time, please don't forgot those cases do "_scratch_mkfs_xxx ... | _fail ...".

Thanks,
Zorro

>
diff mbox series

Patch

diff --git a/common/config b/common/config
index 2a1434bb..4bd5650f 100644
--- a/common/config
+++ b/common/config
@@ -932,6 +932,9 @@  else
 fi
 
 _canonicalize_devices
+# mkfs.xfs checks for TEST_DEV before permitting < 300M filesystems. TEST_DIR
+# and QA_CHECK_FS are also checked by mkfs.xfs, but already exported elsewhere.
+export TEST_DEV
 
 # make sure this script returns success
 /bin/true