Skip to contentSkip to conversation

generic/204: do not call _scratch_mkfs_sized in a pipe

PATCH Superseded Eryu Guan 2 participants 4 messages Nov 5, 2017 – Nov 10, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH 1/1 generic/204: do not call _scratch_mkfs_sized in a pipe

_scratch_mkfs_sized will create a filesystem of the given size, and call _notrun and exit if current $FSTYP doesn't support sized mkfs. But when it's called in a pipe, the exit in _notrun only exits from the subshell created by the pipe not the test itself, and test continues to run unnecessarily.

Fix it by not calling _scratch_mkfs_sized in a pipe, but dumping the output to a tmp file, which will be fed to _filter_mkfs later.

---

This is uncovered by Darrick's patch "generic/204: use available blocks to determine the number of files to create", with this patch applied test will 'hang' when testing on a large NFS export, because the number of files to be created was based on the size of available space.

Note that I've dropped that patch because it also caused failure in 512B block size XFS test.

 tests/generic/204 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/204 +2 -2
index 4c203a213f5b..ebc9c0fa001b 100755
@@ -58,8 +58,8 @@ _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null
 [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50"
 
 SIZE=`expr 115 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null \
-		| _filter_mkfs 2> $tmp.mkfs > /dev/null
+_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null > $tmp.mkfs.raw
+cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null
 _scratch_mount
 
 # Source $tmp.mkfs to get geometry
Signature · 1 line
2.13.6
author
#1 lore raw
Quoted 12 lines · Eryu Guan

_scratch_mkfs_sized will create a filesystem of the given size, and call _notrun and exit if current $FSTYP doesn't support sized mkfs. But when it's called in a pipe, the exit in _notrun only exits from the subshell created by the pipe not the test itself, and test continues to run unnecessarily.

Fix it by not calling _scratch_mkfs_sized in a pipe, but dumping the output to a tmp file, which will be fed to _filter_mkfs later.

---

Quoted 7 lines

This is uncovered by Darrick's patch "generic/204: use available blocks to determine the number of files to create", with this patch applied test will 'hang' when testing on a large NFS export, because the number of files to be created was based on the size of available space.

Note that I've dropped that patch because it also caused failure in 512B block size XFS test.

Ping on this patch, v3 fix of generic/204 from Darrick has been reviewed & queued for next release, it'd be great to have this patch in too.

Thanks,
Eryu

Quoted 22 lines
 tests/generic/204 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/204 +2 -2
index 4c203a213f5b..ebc9c0fa001b 100755
@@ -58,8 +58,8 @@ _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null
 [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50"
 
 SIZE=`expr 115 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null \
-		| _filter_mkfs 2> $tmp.mkfs > /dev/null
+_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null > $tmp.mkfs.raw
+cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null
 _scratch_mount
 
 # Source $tmp.mkfs to get geometry
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#2 lore raw
In reply to Eryu Guan
Quoted 28 lines · Eryu Guan

_scratch_mkfs_sized will create a filesystem of the given size, and call _notrun and exit if current $FSTYP doesn't support sized mkfs. But when it's called in a pipe, the exit in _notrun only exits from the subshell created by the pipe not the test itself, and test continues to run unnecessarily.

Fix it by not calling _scratch_mkfs_sized in a pipe, but dumping the output to a tmp file, which will be fed to _filter_mkfs later.

---

This is uncovered by Darrick's patch "generic/204: use available blocks to determine the number of files to create", with this patch applied test will 'hang' when testing on a large NFS export, because the number of files to be created was based on the size of available space.

Note that I've dropped that patch because it also caused failure in 512B block size XFS test.

 tests/generic/204 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/204 +0 -0
index 4c203a213f5b..ebc9c0fa001b 100755

tests/generic/204 _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null · line 62

Quoted 7 lines
tests/generic/204 +2 -2
@@ -58,8 +58,8 @@ _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null
 [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50"
 
 SIZE=`expr 115 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null \
-		| _filter_mkfs 2> $tmp.mkfs > /dev/null
+_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null > $tmp.mkfs.raw
+cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null

Looks ok,

Though xfs/015 seems to employ this same strategy (piped mkfs_sized) so that test needs fixing too, right?

--D

Quoted 10 lines
tests/generic/204 +0 -0
 _scratch_mount
 
 # Source $tmp.mkfs to get geometry
Signature · 6 lines
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#3 lore raw
Quoted 31 lines · Darrick J. Wong
Quoted 30 lines · Eryu Guan

_scratch_mkfs_sized will create a filesystem of the given size, and call _notrun and exit if current $FSTYP doesn't support sized mkfs. But when it's called in a pipe, the exit in _notrun only exits from the subshell created by the pipe not the test itself, and test continues to run unnecessarily.

Fix it by not calling _scratch_mkfs_sized in a pipe, but dumping the output to a tmp file, which will be fed to _filter_mkfs later.

---

This is uncovered by Darrick's patch "generic/204: use available blocks to determine the number of files to create", with this patch applied test will 'hang' when testing on a large NFS export, because the number of files to be created was based on the size of available space.

Note that I've dropped that patch because it also caused failure in 512B block size XFS test.

 tests/generic/204 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/204 +0 -0
index 4c203a213f5b..ebc9c0fa001b 100755
@@ -58,8 +58,8 @@ _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null
 [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50"
 
Quoted 8 lines

tests/generic/204 _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null · line 62

Quoted 5 lines
tests/generic/204 +2 -2
 SIZE=`expr 115 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null \
-		| _filter_mkfs 2> $tmp.mkfs > /dev/null
+_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null > $tmp.mkfs.raw
+cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null

Looks ok,

Thanks!

Quoted 3 lines

Though xfs/015 seems to employ this same strategy (piped mkfs_sized) so that test needs fixing too, right?

I did do a grep for the piped mkfs_sized pattern through all the tests but apparently missed xfs/015.. Will fix that too in v2.

Thanks,
Eryu

Quoted 13 lines

--D

Quoted 10 lines
tests/generic/204 +0 -0
 _scratch_mount
 
 # Source $tmp.mkfs to get geometry
Signature · 6 lines
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html