Skip to contentSkip to conversation

xfstests: Enable _test_mkfs to force a mkfs on a xfs filesystem

PATCH In review [email protected] 3 participants 8 messages May 24, 2023 – Jun 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: Enable _test_mkfs to force a mkfs on a xfs filesystem

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -0
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Wed, May 24, 2023 at 03:42:07PM +0200, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

Quoted 4 lines

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

Makese sense to me,

--D

Quoted 21 lines
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -0
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
Signature · 1 line
2.30.2
#2 lore raw
Quoted 9 lines · Darrick J. Wong
Quoted 8 lines · On Wed, May 24, 2023 at 03:42:07PM +0200, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

Quoted 7 lines
Quoted 4 lines

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

Makese sense to me,

Hi Darrick,

I just noticed that there's not any place use "_test_options mkfs", I remembered SCRATCH_DEV support rtdev and logdev, the TEST_DEV looks not support that, but the "_test_options()" looks like hoping to support.

Thanks,
Zorro

Quoted 25 lines

--D

Quoted 21 lines
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -0
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
Signature · 1 line
2.30.2
#3 lore raw
Quoted 15 lines · Zorro Lang
Quoted 14 lines · Darrick J. Wong
Quoted 12 lines · On Wed, May 24, 2023 at 03:42:07PM +0200, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

Quoted 8 lines
Quoted 2 lines

Makese sense to me,

Hi Darrick,

I just noticed that there's not any place use "_test_options mkfs", I remembered SCRATCH_DEV support rtdev and logdev, the TEST_DEV looks not support that, but the "_test_options()" looks like hoping to support.

Hmmm, that's a very good point -- _test_mkfs() fails to format a test filesystem with external logs or rt volumes even if the config specified that. Perhaps change the patch to add:

xfs)
_test_options mkfs
$MKFS_XFS_PROG -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV ;;

Does that look right?

--D

Quoted 29 lines

Thanks,
Zorro

Quoted 25 lines

--D

Quoted 21 lines
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -0
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
Signature · 1 line
2.30.2
#4 lore raw
Quoted 25 lines · Darrick J. Wong
Quoted 15 lines · Zorro Lang
Quoted 14 lines · Darrick J. Wong
Quoted 12 lines · On Wed, May 24, 2023 at 03:42:07PM +0200, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

Quoted 8 lines
Quoted 2 lines

Makese sense to me,

Hi Darrick,

I just noticed that there's not any place use "_test_options mkfs", I remembered SCRATCH_DEV support rtdev and logdev, the TEST_DEV looks not support that, but the "_test_options()" looks like hoping to support.

Quoted 6 lines

Hmmm, that's a very good point -- _test_mkfs() fails to format a test filesystem with external logs or rt volumes even if the config specified that. Perhaps change the patch to add:

xfs)
_test_options mkfs

Current _test_options() only works for xfs, it returns directly if FSTYP != XFS. It more likes a _test_xfs_options. We don't have _test_$FSTYP_options() function, so if we'd like to have a common _test_options(), I think we should deal with fs specific things in _test_options() inside, then call _test_options once before the "case $FSTYP in ...".

Thanks,
Zorro

Quoted 37 lines

$MKFS_XFS_PROG -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV ;;

Does that look right?

--D

Quoted 29 lines

Thanks,
Zorro

Quoted 25 lines

--D

Quoted 21 lines
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -0
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
Signature · 1 line
2.30.2
#5 lore raw
Quoted 30 lines · Zorro Lang
Quoted 29 lines · Darrick J. Wong
Quoted 15 lines · Zorro Lang
Quoted 14 lines · Darrick J. Wong
Quoted 12 lines · On Wed, May 24, 2023 at 03:42:07PM +0200, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

Quoted 8 lines
Quoted 2 lines

Makese sense to me,

Hi Darrick,

I just noticed that there's not any place use "_test_options mkfs", I remembered SCRATCH_DEV support rtdev and logdev, the TEST_DEV looks not support that, but the "_test_options()" looks like hoping to support.

Hmmm, that's a very good point -- _test_mkfs() fails to format a test filesystem with external logs or rt volumes even if the config specified that. Perhaps change the patch to add:

Quoted 8 lines
Quoted 2 lines

xfs)
_test_options mkfs

Current _test_options() only works for xfs, it returns directly if FSTYP != XFS. It more likes a _test_xfs_options. We don't have _test_$FSTYP_options() function, so if we'd like to have a common _test_options(), I think we should deal with fs specific things in _test_options() inside, then call _test_options once before the "case $FSTYP in ...".

This seems fine, I'm short on time these days, I'll try to find some time to work on this.

But in meantime, wouldn't it required the '-f' option to be passed to mkfs.xfs anyway? Calling _test_options before 'case $FSTYP ...' will still require use to call mkfs.xfs -f, so, can't the initial patch be applied already? If Darrick's updated solution isn't good enough for now, the original patch will fix at least part of the problem (without external log/rtdev cases) right away.

Signature · 1 line
Carlos
Quoted 42 lines

Thanks,
Zorro

Quoted 37 lines

$MKFS_XFS_PROG -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV ;;

Does that look right?

--D

Quoted 29 lines

Thanks,
Zorro

Quoted 25 lines

--D

Quoted 21 lines
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -1
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
--

2.30.2

#6 lore raw
Quoted 40 lines · Carlos Maiolino
Quoted 30 lines · Zorro Lang
Quoted 29 lines · Darrick J. Wong
Quoted 15 lines · Zorro Lang
Quoted 14 lines · Darrick J. Wong
Quoted 12 lines · On Wed, May 24, 2023 at 03:42:07PM +0200, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

Quoted 8 lines
Quoted 2 lines

Makese sense to me,

Hi Darrick,

I just noticed that there's not any place use "_test_options mkfs", I remembered SCRATCH_DEV support rtdev and logdev, the TEST_DEV looks not support that, but the "_test_options()" looks like hoping to support.

Hmmm, that's a very good point -- _test_mkfs() fails to format a test filesystem with external logs or rt volumes even if the config specified that. Perhaps change the patch to add:

Quoted 8 lines
Quoted 2 lines

xfs)
_test_options mkfs

Current _test_options() only works for xfs, it returns directly if FSTYP != XFS. It more likes a _test_xfs_options. We don't have _test_$FSTYP_options() function, so if we'd like to have a common _test_options(), I think we should deal with fs specific things in _test_options() inside, then call _test_options once before the "case $FSTYP in ...".

Quoted 8 lines

This seems fine, I'm short on time these days, I'll try to find some time to work on this.

But in meantime, wouldn't it required the '-f' option to be passed to mkfs.xfs anyway? Calling _test_options before 'case $FSTYP ...' will still require use to call mkfs.xfs -f, so, can't the initial patch be applied already? If Darrick's updated solution isn't good enough for now, the original patch will fix at least part of the problem (without external log/rtdev cases) right away.

Yes, let's please get at least the bare fix merged.

--D

Quoted 45 lines
Signature · 1 line
Carlos
Quoted 42 lines

Thanks,
Zorro

Quoted 37 lines

$MKFS_XFS_PROG -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV ;;

Does that look right?

--D

Quoted 29 lines

Thanks,
Zorro

Quoted 25 lines

--D

Quoted 21 lines
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -1
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
--

2.30.2

#7 lore raw
Quoted 44 lines · Darrick J. Wong
Quoted 43 lines · Carlos Maiolino
Quoted 30 lines · Zorro Lang
Quoted 29 lines · Darrick J. Wong
Quoted 15 lines · Zorro Lang
Quoted 14 lines · Darrick J. Wong
Quoted 12 lines · On Wed, May 24, 2023 at 03:42:07PM +0200, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Calling _test_mkfs on an already initialized xfs FS will fail as the initialization is not enforced by '-f' argument, unless it's included in MKFS_OPTIONS.
So, adding 'RECREATE_TEST_DEV=true' to the config file end up being useless for xfs filesystems.

So, adding the a specific xfs optiong in _test_mkfs using -f argument makes RECREATE_TEST_DEV actually useful.

Quoted 8 lines
Quoted 2 lines

Makese sense to me,

Hi Darrick,

I just noticed that there's not any place use "_test_options mkfs", I remembered SCRATCH_DEV support rtdev and logdev, the TEST_DEV looks not support that, but the "_test_options()" looks like hoping to support.

Hmmm, that's a very good point -- _test_mkfs() fails to format a test filesystem with external logs or rt volumes even if the config specified that. Perhaps change the patch to add:

Quoted 8 lines
Quoted 2 lines

xfs)
_test_options mkfs

Current _test_options() only works for xfs, it returns directly if FSTYP != XFS. It more likes a _test_xfs_options. We don't have _test_$FSTYP_options() function, so if we'd like to have a common _test_options(), I think we should deal with fs specific things in _test_options() inside, then call _test_options once before the "case $FSTYP in ...".

This seems fine, I'm short on time these days, I'll try to find some time to work on this.

Quoted 7 lines
Quoted 5 lines

But in meantime, wouldn't it required the '-f' option to be passed to mkfs.xfs anyway? Calling _test_options before 'case $FSTYP ...' will still require use to call mkfs.xfs -f, so, can't the initial patch be applied already? If Darrick's updated solution isn't good enough for now, the original patch will fix at least part of the problem (without external log/rtdev cases) right away.

Yes, let's please get at least the bare fix merged.

OK, we can have this fix at first, then think about _test_options in another patch.

Thanks,
Zorro

Quoted 49 lines

--D

Quoted 45 lines
Signature · 1 line
Carlos
Quoted 42 lines

Thanks,
Zorro

Quoted 37 lines

$MKFS_XFS_PROG -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV ;;

Does that look right?

--D

Quoted 29 lines

Thanks,
Zorro

Quoted 25 lines

--D

Quoted 21 lines
---
 common/rc | 3 +++
 1 file changed, 3 insertions(+)
common/rc +3 -1
index 37074371..dd5d7bc1 100644
@@ -605,6 +605,9 @@ _test_mkfs()
     ext2|ext3|ext4)
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
+    xfs)
+	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $TEST_DEV
 	;;
--

2.30.2