Skip to contentSkip to conversation

xfstests shared/298: various fixes

PATCH In review Eric Sandeen 4 participants 7 messages Apr 26, 2013 – May 14, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests shared/298: various fixes

fix shared/298:

* don't include common/config, not needed and breaks
stuff when $SCRATCH_DEV_POOL is defined:
Error: $SCRATCH_DEV should be unset when $SCRATCH_DEV_POOL is set
* make sure xfs_io has fiemap, we'll need it
* add -F to the xfs_io invocation, again
* ignore ENOSPC errors from "garbage" loop; the only goal is to fill it, ENOSPC doesn't matter.

---

Wondering if we should just add " -F" to $XFS_IO_PROG . . .

tests/shared/298 +5 -4
index f1a3432..e2eddda 100755
@@ -28,12 +28,12 @@ echo "QA output created by $seq"
 status=1	# failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
-. common/config
 . common/rc
 
 _supported_fs ext4 xfs
 _supported_os Linux
 _require_fstrim
+_require_xfs_io_fiemap
 _require_fs_space $TEST_DIR 307200
 [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
 
@@ -49,7 +49,7 @@ _cleanup()
 
 get_holes()
 {
-	$XFS_IO_PROG -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
+	$XFS_IO_PROG -F -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
 }
 
 get_free_sectors()
@@ -136,9 +136,10 @@ $MKFS_PROG -t $FSTYP $MKFS_OPTIONS $loop_dev &> /dev/null
 $MOUNT_PROG $loop_dev $loop_mnt
 
 echo -n "Generating garbage on loop..."
+# Goal is to fill it up, ignore any errors.
 for i in `seq 1 10`; do
-	mkdir $loop_mnt/$i
-	cp -r $here/* $loop_mnt/$i
+	mkdir $loop_mnt/$i &> /dev/null
+	cp -r $here/* $loop_mnt/$i &> /dev/null
 done
 
 # Get reference fiemap, this can contain i.e. uninitialized inode table

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 7 lines · Eric Sandeen

fix shared/298:

* don't include common/config, not needed and breaks
stuff when $SCRATCH_DEV_POOL is defined:
Error: $SCRATCH_DEV should be unset when $SCRATCH_DEV_POOL is set
* make sure xfs_io has fiemap, we'll need it
* add -F to the xfs_io invocation, again

What's it needed for this time?

Quoted 36 lines

* ignore ENOSPC errors from "garbage" loop; the only goal is to fill it, ENOSPC doesn't matter.

---

Wondering if we should just add " -F" to $XFS_IO_PROG . . .

tests/shared/298 +2 -2
index f1a3432..e2eddda 100755
@@ -28,12 +28,12 @@ echo "QA output created by $seq"
 status=1	# failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
-. common/config
 . common/rc
 
 _supported_fs ext4 xfs
 _supported_os Linux
 _require_fstrim
+_require_xfs_io_fiemap
 _require_fs_space $TEST_DIR 307200
 [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
 
@@ -49,7 +49,7 @@ _cleanup()
 
 get_holes()
 {
-	$XFS_IO_PROG -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
+	$XFS_IO_PROG -F -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
 }
 
 get_free_sectors()

tests/shared/298 $MKFS_PROG -t $FSTYP $MKFS_OPTIONS $loop_dev &> /dev/null · line 142

Quoted 9 lines
tests/shared/298 +3 -2
@@ -136,9 +136,10 @@ $MKFS_PROG -t $FSTYP $MKFS_OPTIONS $loop_dev &> /dev/null
 $MOUNT_PROG $loop_dev $loop_mnt
 
 echo -n "Generating garbage on loop..."
+# Goal is to fill it up, ignore any errors.
 for i in `seq 1 10`; do
-	mkdir $loop_mnt/$i
-	cp -r $here/* $loop_mnt/$i
+	mkdir $loop_mnt/$i &> /dev/null
+	cp -r $here/* $loop_mnt/$i &> /dev/null

Can you break out of the loop once cp fails with an error? There's no point hammering the filesystem for several loops after the first ENOSPC occurs....

-Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#2 lore raw
Quoted 10 lines · Dave Chinner
Quoted 7 lines · Eric Sandeen

fix shared/298:

* don't include common/config, not needed and breaks
stuff when $SCRATCH_DEV_POOL is defined:
Error: $SCRATCH_DEV should be unset when $SCRATCH_DEV_POOL is set
* make sure xfs_io has fiemap, we'll need it
* add -F to the xfs_io invocation, again

What's it needed for this time?

the same as last time. :) using old xfs_io on a non-xfs fs.

Quoted 38 lines
Quoted 38 lines

* ignore ENOSPC errors from "garbage" loop; the only goal is to fill it, ENOSPC doesn't matter.

---

Wondering if we should just add " -F" to $XFS_IO_PROG . . .

tests/shared/298 +2 -2
index f1a3432..e2eddda 100755
@@ -28,12 +28,12 @@ echo "QA output created by $seq"
 status=1	# failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
-. common/config
 . common/rc
 
 _supported_fs ext4 xfs
 _supported_os Linux
 _require_fstrim
+_require_xfs_io_fiemap
 _require_fs_space $TEST_DIR 307200
 [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
 
@@ -49,7 +49,7 @@ _cleanup()
 
 get_holes()
 {
-	$XFS_IO_PROG -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
+	$XFS_IO_PROG -F -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
 }
 
 get_free_sectors()
@@ -136,9 +136,10 @@ $MKFS_PROG -t $FSTYP $MKFS_OPTIONS $loop_dev &> /dev/null
 $MOUNT_PROG $loop_dev $loop_mnt
 
Quoted 11 lines

tests/shared/298 $MKFS_PROG -t $FSTYP $MKFS_OPTIONS $loop_dev &> /dev/null · line 142

Quoted 7 lines
tests/shared/298 +3 -2
 echo -n "Generating garbage on loop..."
+# Goal is to fill it up, ignore any errors.
 for i in `seq 1 10`; do
-	mkdir $loop_mnt/$i
-	cp -r $here/* $loop_mnt/$i
+	mkdir $loop_mnt/$i &> /dev/null
+	cp -r $here/* $loop_mnt/$i &> /dev/null

Can you break out of the loop once cp fails with an error? There's no point hammering the filesystem for several loops after the first ENOSPC occurs....

yeah, ok.

Thanks,
-Eric

Quoted 2 lines

-Dave.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

PATCH v2 1/1 xfstests shared/298: various fixes

In reply to Eric Sandeen

fix shared/298:

* don't include common/config, not needed and breaks
stuff when $SCRATCH_DEV_POOL is defined:
Error: $SCRATCH_DEV should be unset when $SCRATCH_DEV_POOL is set
* make sure xfs_io has fiemap, we'll need it
* add -F to the xfs_io invocation, again, for use on
old xfsprogs on non-xfs filesystems
* ignore ENOSPC errors from "garbage" loop; the only goal is to fill it, ENOSPC doesn't matter.

---

V2: break out of copy loop when full

tests/shared/298 +6 -5
index f1a3432..4541798 100755
@@ -28,12 +28,12 @@ echo "QA output created by $seq"
 status=1	# failure is the default!
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
-. common/config
-. common/rc
+. ./common/rc
 
 _supported_fs ext4 xfs
 _supported_os Linux
 _require_fstrim
+_require_xfs_io_fiemap
 _require_fs_space $TEST_DIR 307200
 [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
 
@@ -49,7 +49,7 @@ _cleanup()
 
 get_holes()
 {
-	$XFS_IO_PROG -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
+	$XFS_IO_PROG -F -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
 }
 
 get_free_sectors()
@@ -136,9 +136,10 @@ $MKFS_PROG -t $FSTYP $MKFS_OPTIONS $loop_dev &> /dev/null
 $MOUNT_PROG $loop_dev $loop_mnt
 
 echo -n "Generating garbage on loop..."
+# Goal is to fill it up, ignore any errors.
 for i in `seq 1 10`; do
-	mkdir $loop_mnt/$i
-	cp -r $here/* $loop_mnt/$i
+	mkdir $loop_mnt/$i &> /dev/null
+	cp -r $here/* $loop_mnt/$i &> /dev/null || break
 done
 
 # Get reference fiemap, this can contain i.e. uninitialized inode table

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw
Quoted 11 lines · Eric Sandeen

fix shared/298:

* don't include common/config, not needed and breaks
stuff when $SCRATCH_DEV_POOL is defined:
Error: $SCRATCH_DEV should be unset when $SCRATCH_DEV_POOL is set
* make sure xfs_io has fiemap, we'll need it
* add -F to the xfs_io invocation, again, for use on
old xfsprogs on non-xfs filesystems
* ignore ENOSPC errors from "garbage" loop; the only goal is to fill it, ENOSPC doesn't matter.

Quoted 4 lines

---

V2: break out of copy loop when full

Dave, looks like Eric applied your suggestions, may I put your Reviewed-by on this one?

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw
In reply to Eric Sandeen
Quoted 11 lines · Eric Sandeen

fix shared/298:

* don't include common/config, not needed and breaks
stuff when $SCRATCH_DEV_POOL is defined:
Error: $SCRATCH_DEV should be unset when $SCRATCH_DEV_POOL is set
* make sure xfs_io has fiemap, we'll need it
* add -F to the xfs_io invocation, again, for use on
old xfsprogs on non-xfs filesystems
* ignore ENOSPC errors from "garbage" loop; the only goal is to fill it, ENOSPC doesn't matter.

Quoted 1 line

This has been committed:

commit ecd7386cc9ddb9c4661bae563dc9cbb5835a9e45

Author: Eric Sandeen <[email protected]>
Date:   Tue May 14 13:08:45 2013 -0500

xfstests shared/298: various fixes

Thanks
--Rich

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs