public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] [XFSQA] Optimisations and ENOSPC tests
@ 2009-03-15 10:49 Dave Chinner
  2009-03-15 10:49 ` [PATCH 1/3] [XFSQA] Reduce the number of processes forked Dave Chinner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dave Chinner @ 2009-03-15 10:49 UTC (permalink / raw)
  To: xfs

The first patch reduces the number of forks required by some
qa tests by using shell builtins. Tests run faster on UML
if they fork less.

The other two patches introduce tests that trip over
spurious ENOSPC errors. A followup patch series will fix
these test failures.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] [XFSQA] Reduce the number of processes forked
  2009-03-15 10:49 [PATCH 0/3] [XFSQA] Optimisations and ENOSPC tests Dave Chinner
@ 2009-03-15 10:49 ` Dave Chinner
  2009-03-16  6:23   ` Christoph Hellwig
  2009-03-15 10:49 ` [PATCH 2/3] [XFSQA] Add simple delayed allocation ENOSPC test Dave Chinner
  2009-03-15 10:49 ` [PATCH 3/3] [XFSQA] Test writing to ENOSPC Dave Chinner
  2 siblings, 1 reply; 7+ messages in thread
From: Dave Chinner @ 2009-03-15 10:49 UTC (permalink / raw)
  To: xfs

One of the big cpu time consumers when running xfsqa on UML
is forking of new processes. when looping lots of times,
using 'expr' to calculate the loop counter increment means
we fork at least once every loop. using shell builtins means
that we don't fork and many tests run substantially faster.

Some tests are even runnable with this modification. e.g. 110
went from taking 4500s to run down to 9s with the loop iterators
changed to avoid forking.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 007         |    2 +-
 028         |    2 +-
 031         |    2 +-
 047         |    2 +-
 053         |    4 ++--
 064         |    8 ++++----
 065         |    8 ++++----
 068         |    6 +++---
 071         |    2 +-
 089         |    2 +-
 109         |    8 ++++----
 110         |    6 +++---
 111         |    2 +-
 113         |    2 +-
 114         |    4 ++--
 117         |    2 +-
 119         |    2 +-
 136         |   14 +++++++-------
 137         |    4 ++--
 138         |    4 ++--
 139         |    4 ++--
 140         |    4 ++--
 149         |    2 +-
 165         |    8 ++++----
 179         |    4 ++--
 180         |    4 ++--
 182         |    4 ++--
 common.attr |    6 +++---
 common.dump |   12 ++++++------
 common.rc   |   10 +++++-----
 30 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/007 b/007
index e8c6610..290f716 100755
--- a/007
+++ b/007
@@ -50,7 +50,7 @@ num_filenames=100
 i=1
 while [ $i -le $num_filenames ]; do
   echo "nametest.$i" >>$sourcefile
-  i=`expr $i + 1`
+  let i=$i+1
 done
 
 mkdir $testdir/$seq
diff --git a/028 b/028
index 1b679f2..2c353fa 100755
--- a/028
+++ b/028
@@ -44,7 +44,7 @@ while [ $i -lt 5 ]; do
     fi
     rm $dump_file
     sleep 2
-    i=`expr $i + 1`
+    let i=$i+1
 done
 
 echo "middate = $middate" >>$seq.full
diff --git a/031 b/031
index 779cf27..7ddd842 100755
--- a/031
+++ b/031
@@ -71,7 +71,7 @@ EOF
 
 	while [ $count -lt $total ]
 	do
-		count=`expr $count + 1`
+		let count=$count+1
 		cat >>$tmp.proto <<EOF
 ${count}_of_${total}_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---755 3 1 /bin/true
 EOF
diff --git a/047 b/047
index 168ada1..7ee9ed5 100755
--- a/047
+++ b/047
@@ -44,7 +44,7 @@ while [ $i -lt 5 ]; do
     fi
     rm $dump_file
     sleep 2
-    i=`expr $i + 1`
+    let i=$i+1
 done
 
 echo "middate = $middate" >>$seq.full
diff --git a/053 b/053
index f260e1a..dbd2d5d 100755
--- a/053
+++ b/053
@@ -54,7 +54,7 @@ for acl in $acls
 do
   _do "touch $test.$i"
   _do "chacl $acl $test.$i"
-  i=`expr $i + 1`
+  let i=$i+1
 done
 
 list_acls()
@@ -63,7 +63,7 @@ list_acls()
   for acl in $acls
   do
     chacl -l $test.$i | _acl_filter_id | sed -e "s!$SCRATCH_MNT!\$SCRATCH_MNT!"
-    i=`expr $i + 1`
+    let i=$i+1
   done
 }
 
diff --git a/064 b/064
index 27ee1da..5a7d4b4 100755
--- a/064
+++ b/064
@@ -58,7 +58,7 @@ while [ $i -le 9 ]; do
     date >>$seq.full
     find $SCRATCH_MNT -exec $here/src/lstat64 {} \; | sed 's/(00.*)//' >$tmp.dates.$i
     if [ $i -gt 0 ]; then
-       level_1=`expr $i - 1`
+       let level_1=$i-1
        diff -c $tmp.dates.$level_1 $tmp.dates.$i >>$seq.full
     else
        cat $tmp.dates.$i >>$seq.full
@@ -66,7 +66,7 @@ while [ $i -le 9 ]; do
 
     dump_file=$tmp.df.level$i
     _do_dump_file -l $i
-    i=`expr $i + 1`	
+    let i=$i+1
 done
 
 echo "Listing of what files we start with:"
@@ -79,7 +79,7 @@ while [ $i -le 9 ]; do
     echo "restoring from df.level$i"
     dump_file=$tmp.df.level$i
     _do_restore_toc
-    i=`expr $i + 1`	
+    let i=$i+1
 done
 
 echo "Do the cumulative restores"
@@ -91,7 +91,7 @@ while [ $i -le 9 ]; do
     _do_restore_file_cum -l $i
     echo "ls -l restore_dir"
     ls -lR $restore_dir | _ls_size_filter | _check_quota_file
-    i=`expr $i + 1`	
+    let i=$i+1
 done
 
 # success, all done
diff --git a/065 b/065
index b193f28..4252b11 100755
--- a/065
+++ b/065
@@ -146,7 +146,7 @@ while [ $i -le $num_dumps ]; do
 
     dump_file=$tmp.df.level$i
     _do_dump_file -l $i
-    i=`expr $i + 1`
+    let i=$i+1
 done
 
 echo "Look at what files are contained in the inc. dump"
@@ -156,7 +156,7 @@ while [ $i -le $num_dumps ]; do
     echo "restoring from df.level$i"
     dump_file=$tmp.df.level$i
     _do_restore_toc
-    i=`expr $i + 1`
+    let i=$i+1
 done
 
 echo "Do the cumulative restores"
@@ -168,7 +168,7 @@ while [ $i -le $num_dumps ]; do
     _do_restore_file_cum -l $i
     echo "list restore_dir"
     _list_dir $restore_dir | _check_quota_file | tee $tmp.restorals.$i
-    i=`expr $i + 1`
+    let i=$i+1
 done
 
 echo ""
@@ -178,7 +178,7 @@ while [ $i -le $num_dumps ]; do
     echo "Comparing ls of FS with restored FS at level $i"
     diff -s $tmp.ls.$i $tmp.restorals.$i | sed "s#$tmp#TMP#g"
     echo ""
-    i=`expr $i + 1`
+    let i=$i+1
 done
 
 
diff --git a/068 b/068
index eb8b936..af060ae 100755
--- a/068
+++ b/068
@@ -75,7 +75,7 @@ touch $tmp.running
 } &
 
 i=0
-ITERATIONS=`expr $ITERATIONS - 1`
+let ITERATIONS=$ITERATIONS-1
 
 echo | tee -a $seq.full
 while [ $i -le $ITERATIONS ]
@@ -94,7 +94,7 @@ do
 	sleep 2
 
 	echo  | tee -a $seq.full
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # stop fsstress iterations
@@ -105,4 +105,4 @@ wait
 
 _check_scratch_fs
 
-exit 1
\ No newline at end of file
+exit 1
diff --git a/071 b/071
index 5e621ba..4e95804 100755
--- a/071
+++ b/071
@@ -137,7 +137,7 @@ do
     echo === Iterating, `expr $upperbound - $count` remains
     echo
     echo
-    count=`expr $count + 1`
+    let count=$count+1
 done
 
 # success, all done
diff --git a/089 b/089
index db7525b..9f77c05 100755
--- a/089
+++ b/089
@@ -30,7 +30,7 @@ addentries()
 
 	while [ $count -gt 0 ]; do
 		touch `printf $pattern $count`
-		count=`expr $count - 1`
+		let count=$count-1
 	done
 }
 
diff --git a/109 b/109
index 913ceea..845f1f2 100755
--- a/109
+++ b/109
@@ -38,7 +38,7 @@ populate()
 	while [ $i -le $files -a "X$faststart" = "X" ]; do
 		file=$SCRATCH_MNT/f$i
 		xfs_io -f -d -c 'pwrite -b 64k 0 64k' $file >/dev/null
-		i=`expr $i + 1`
+		let i=$i+1
 	done
 
 	# remove every second file, freeing up lots of space
@@ -46,7 +46,7 @@ populate()
 	i=1
 	while [ $i -le $files -a "X$faststart" = "X" ]; do
 		rm $SCRATCH_MNT/f$i
-		i=`expr $i + 2`
+		let i=$i+2
 	done
 
 	echo "flushing changes via umount/mount."
@@ -67,10 +67,10 @@ allocate()
 				xfs_io -f -c 'pwrite -b 64k 0 16m' $file \
 					>/dev/null 2>&1
 				rm $file
-				j=`expr $j + 1`
+				let j=$j+1
 			done
 		} &
-		i=`expr $i + 1`
+		let i=$i+1
 	done
 
 	wait
diff --git a/110 b/110
index c578d35..85b313c 100755
--- a/110
+++ b/110
@@ -52,8 +52,8 @@ E=10030600
 while [ $I -le $E ]
 do
     echo > $SCRATCH_MNT/test/${STR1}${STR2}${STR3}${I}
-    I=`expr $I + 1`
-    [ `expr $I % 1000` -eq 0 ] && echo "Created $I/$E"
+    let I=$I+1
+    [ $[$I % 1000] -eq 0 ] && echo "Created $I/$E"
 done
 
 sync
@@ -63,7 +63,7 @@ E=10030599
 while [ $I -le $E ]
 do
     rm $SCRATCH_MNT/test/${STR1}${STR2}${STR3}${I} &
-    I=`expr $I + 1`
+    let I=$I+1
 done
 
 _check_scratch_fs
diff --git a/111 b/111
index 46f1395..060c0bc 100755
--- a/111
+++ b/111
@@ -39,7 +39,7 @@ I=0
 while [ $I -lt 1000 ]
 do
     cp src/itrash.c $SCRATCH_MNT/${I}
-    I=`expr $I + 1`
+    let I=$I+1
 done
 umount $SCRATCH_DEV
 
diff --git a/113 b/113
index 9c435cf..49c8cee 100755
--- a/113
+++ b/113
@@ -41,7 +41,7 @@ _do_test()
     [ $__proc -gt 1 ] && _param="-t $__proc $_param"
     while [ $__proc -gt 1 ]; do
         _files="$_files $testdir/aiostress.$$.$_n.$__proc"
-	__proc=`expr $__proc - 1`
+	let __proc=$__proc-1
     done
     rm -f $_files
  
diff --git a/114 b/114
index 5f7c23d..af8608c 100755
--- a/114
+++ b/114
@@ -135,8 +135,8 @@ _test_hardlink()
 	paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
 	i=0
 	for x in $paths; do
-		i=`expr $i + 1`
-		j=`expr $i % 2`
+		let i=$i+1
+		let j=$i%2
 		if [ $j -eq 0 ]; then
 			echo "rm'ing $x"
 			rm $x
diff --git a/117 b/117
index 5fee416..7cb91d1 100755
--- a/117
+++ b/117
@@ -71,7 +71,7 @@ while [ $i -lt $ITERATIONS ]; do
         -s $seed \
 	-S -p 1 -n 1000 >>$seq.full 2>&1
 
-    i=`expr $i + 1`
+    let i=$i+1
 done
 
 cd /
diff --git a/119 b/119
index 8d23495..055928c 100755
--- a/119
+++ b/119
@@ -54,7 +54,7 @@ while [ $i -lt $max ]; do
 	xfs_freeze -f $SCRATCH_MNT
 	xfs_freeze -u $SCRATCH_MNT
 	echo -n .
-	i=`expr $i + 1`
+	let i=$i+1
 done
 echo "done"
 
diff --git a/136 b/136
index 0978ac9..c3e010c 100755
--- a/136
+++ b/136
@@ -61,7 +61,7 @@ add_eas()
     i=$start
     while [ $i -le $end ]; do 
 	attr -s name.$i -V value $file >/dev/null
-	i=`expr $i + 1`
+	let i=$i+1
     done
 }
 
@@ -73,7 +73,7 @@ rm_eas()
     i=$start
     while [ $i -le $end ]; do 
 	attr -r name.$i $file >/dev/null
-	i=`expr $i + 1`
+	let i=$i+1
     done
 }
 
@@ -171,7 +171,7 @@ _test_add_extents()
 	while [ $j -le 30 ]; do
 	    do_extents $j
 	    _print_inode
-	    j=`expr $j + 2`
+	    let j=$j+2
 	done
 
 	#scale down
@@ -179,7 +179,7 @@ _test_add_extents()
 	while [ $j -ge 1 ]; do
 	    do_extents $j
 	    _print_inode
-	    j=`expr $j - 2`
+	    let j=$j-2
 	done
 
 	#build up
@@ -187,7 +187,7 @@ _test_add_extents()
 	while [ $j -le 30 ]; do
 	    do_extents $j
 	    _print_inode
-	    j=`expr $j + 2`
+	    let j=$j+2
 	done
 }
 
@@ -211,7 +211,7 @@ _test_extents_eas()
 	    _print_inode
 	    _print_inode_u > $tmp.u1
 	    for j in `seq 1 $EAs_inc $EAs_max`; do
-		k=`expr $j + $EAs_inc - 1`
+		let k=$k+$EAs_inc-1
 		add_eas $j $k
 	    done
 	    # should have same extents
@@ -256,7 +256,7 @@ _test_eas_extents()
 	EAs_inc=5
 	for j in `seq 1 $EAs_inc $EAs_max`; do
 
-	    k=`expr $j + $EAs_inc - 1`
+	    let k=$k+$EAs_inc-1
 	    add_eas $j $k
 	    echo "--- EAs: $j ---"
 
diff --git a/137 b/137
index 4dbf847..f27a248 100755
--- a/137
+++ b/137
@@ -47,7 +47,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # give the system a chance to write something out
@@ -90,7 +90,7 @@ do
 			rm -f $file
 		fi
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 status=0
diff --git a/138 b/138
index 7cf9020..bf36e3d 100755
--- a/138
+++ b/138
@@ -53,7 +53,7 @@ do
 		echo error truncating file $file
 		exit
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # give the system a chance to write something out
@@ -96,7 +96,7 @@ do
 			rm -f $file
 		fi
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 status=0
diff --git a/139 b/139
index 4805279..5fd2a64 100755
--- a/139
+++ b/139
@@ -53,7 +53,7 @@ do
 		echo error truncating file $file
 		exit
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # give the system a chance to write something out
@@ -96,7 +96,7 @@ do
 			rm -f $file
 		fi
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 status=0
diff --git a/140 b/140
index 797efc4..e5d63a6 100755
--- a/140
+++ b/140
@@ -53,7 +53,7 @@ do
 		echo error truncating file $file
 		exit
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # give the system a chance to write something out
@@ -93,7 +93,7 @@ do
 			rm -f $file
 		fi
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 status=0
diff --git a/149 b/149
index 0e9d974..8fea8af 100755
--- a/149
+++ b/149
@@ -74,7 +74,7 @@ EOF
 
 	while [ $count -lt $total ]
 	do
-		count=`expr $count + 1`
+		let count=$count+1
 		cat >>$tmp.proto <<EOF
 ${count}_of_${total}_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---755 3 1 /bin/true
 EOF
diff --git a/165 b/165
index 9eda608..7356a4c 100644
--- a/165
+++ b/165
@@ -82,8 +82,8 @@ do
 
 	$XFS_IO_PROG -c "unresvsp $offset $length" -c "bmap -vp" $testfile | _filter_bmap
 
-	off=`expr $off + $len` # skip over 1
-	off=`expr $off + $len`
+	let off=$off+$len # skip over 1
+	let off=$off+$len
 done
 
 off=0
@@ -111,8 +111,8 @@ do
 	#$XFS_IO_PROG -r -c "pread -v -b $bufsize $offset $length" $testfile
         #sleep 5
 
-	off=`expr $off + $len` # skip over 1
-	off=`expr $off + $len`
+	let off=$off+$len # skip over 1
+	let off=$off+$len
 done
 
 wait
diff --git a/179 b/179
index 6efb70f..c7cd9a7 100644
--- a/179
+++ b/179
@@ -63,7 +63,7 @@ _check_files()
 		else
 			echo file $file missing - fsync failed
 		fi
-		i=`expr $i + 1`
+		let i=$i+1
 	done
 }
 
@@ -78,7 +78,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # shutdown immediately after, then remount and test
diff --git a/180 b/180
index 3ad7972..52a4f7c 100644
--- a/180
+++ b/180
@@ -68,7 +68,7 @@ _check_files()
 		else
 			echo file $file missing - sync failed
 		fi
-		i=`expr $i + 1`
+		let i=$i+1
 	done
 }
 
@@ -83,7 +83,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # sync, then shutdown immediately after, then remount and test
diff --git a/182 b/182
index fdede6d..f112f30 100644
--- a/182
+++ b/182
@@ -63,7 +63,7 @@ _check_files()
 		else
 			echo file $file missing - sync failed
 		fi
-		i=`expr $i + 1`
+		let i=$i+1
 	done
 }
 
@@ -78,7 +78,7 @@ do
 		echo error creating/writing file $file
 		exit
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
 done
 
 # sync, then shutdown immediately after, then remount and test
diff --git a/common.attr b/common.attr
index 31f71f2..5f16273 100644
--- a/common.attr
+++ b/common.attr
@@ -77,11 +77,11 @@ _acl_list()
 #
 _create_n_aces()
 {
-    n=`expr $1 - 4`
+    let n=$1-4
     acl='u::rwx,g::rwx,o::rwx,m::rwx' # 4 ace acl start
     while [ $n -ne 0 ]; do
-       acl="$acl,u:$n:rwx"
-       n=`expr $n - 1` 
+	acl="$acl,u:$n:rwx"
+	let n=$n-1
     done
     echo $acl
 }
diff --git a/common.dump b/common.dump
index c80a9c1..6d2f120 100644
--- a/common.dump
+++ b/common.dump
@@ -97,7 +97,7 @@ _check_onl()
 	else
 	    sleep 1
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
     done
 
 
@@ -135,7 +135,7 @@ _wait_tape()
 	else
 	    sleep 1
 	fi
-	i=`expr $i + 1`
+	let i=$i+1
     done
 }
 
@@ -681,7 +681,7 @@ _create_hardlinks()
 	_hardlink=$_fname$_suffix
 	echo "creating hardlink $_hardlink to $_fname"
 	ln $_fname $_hardlink
-	_j=`expr $_j + 1`
+	let _j=$_j+1
     done
 }
 
@@ -697,7 +697,7 @@ _create_hardset()
     _i=1
     while [ $_i -le $_numsets ]; do
 	_create_hardlinks file$_i 5
-	_i=`expr $_i + 1`
+	let _i=$_i+1
     done
 }
 
@@ -973,7 +973,7 @@ _do_dump_multi_file()
     while [ $i -lt $multi ]
     do
 	multi_args="$multi_args -f $dump_file.$i -M $media_label.$i"
-	i=`expr $i + 1`
+	let i=$i+1
     done
 
     echo "Dumping to files..."
@@ -1093,7 +1093,7 @@ _do_restore_multi_file()
     while [ $i -lt $multi ]
     do
 	multi_args="$multi_args -f $dump_file.$i"
-	i=`expr $i + 1`
+	let i=$i+1
     done
 
     echo "Restoring from file..."
diff --git a/common.rc b/common.rc
index a51ac70..36f978b 100644
--- a/common.rc
+++ b/common.rc
@@ -152,7 +152,7 @@ _mount_ops_filter()
     params="$*"
     
     #get mount point to handle dmapi mtpt option correctly
-    last_index=`expr $# - 1`
+    let last_index=$#-1
     [ $last_index -gt 0 ] && shift $last_index
     FS_ESCAPED=$1
     
@@ -1114,11 +1114,11 @@ _nfiles()
         while [ $f -lt $1 ]
         do
                 file=f$f
-                touch $file
+                echo > $file
                 if [ $size -gt 0 ]; then
                     dd if=/dev/zero of=$file bs=1024 count=$size
                 fi
-                f=`expr $f + 1`
+		let f=$f+1
         done
 }
 
@@ -1132,7 +1132,7 @@ _descend()
         _nfiles $files           # files for this dir
 
         [ $depth -eq 0 ] && return
-        deep=`expr $depth - 1`  # go 1 down
+	let deep=$depth-1 # go 1 down
 
         [ $verbose = true ] && echo "descending, depth from leaves = $deep"
 
@@ -1140,7 +1140,7 @@ _descend()
         while [ $d -lt $dirs ]
         do
                 _descend d$d $deep &
-                d=`expr $d + 1`
+		let d=$d+1
                 wait
         done
 }
-- 
1.6.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] [XFSQA] Add simple delayed allocation ENOSPC test.
  2009-03-15 10:49 [PATCH 0/3] [XFSQA] Optimisations and ENOSPC tests Dave Chinner
  2009-03-15 10:49 ` [PATCH 1/3] [XFSQA] Reduce the number of processes forked Dave Chinner
@ 2009-03-15 10:49 ` Dave Chinner
  2009-03-16  6:23   ` Christoph Hellwig
  2009-03-15 10:49 ` [PATCH 3/3] [XFSQA] Test writing to ENOSPC Dave Chinner
  2 siblings, 1 reply; 7+ messages in thread
From: Dave Chinner @ 2009-03-15 10:49 UTC (permalink / raw)
  To: xfs

Using a small (100MB) filesystem and writing lots of
single block files can result in spurious ENOSPCs
being reported. Reproduce this test case so we can confirm
that it gets fixed.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 203     |   41 +++++++++++++++++++++++++++++++++++++++++
 203.out |    2 ++
 group   |    1 +
 3 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100755 203
 create mode 100644 203.out

diff --git a/203 b/203
new file mode 100755
index 0000000..16c5714
--- /dev/null
+++ b/203
@@ -0,0 +1,41 @@
+#! /bin/sh
+# FS QA Test No. 203
+#
+# Test out ENOSPC flushiung on small filesystems.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2009 Christoph Hellwig.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=hch@lst.de
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+
+_require_scratch
+
+_scratch_mkfs_xfs -d size=104m >/dev/null
+_scratch_mount
+
+for i in `seq 1 22500`; do
+    echo -n > $SCRATCH_MNT/$i
+    echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
+done
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/203.out b/203.out
new file mode 100644
index 0000000..f7476c0
--- /dev/null
+++ b/203.out
@@ -0,0 +1,2 @@
+QA output created by 203
+*** done
diff --git a/group b/group
index 35f02fc..0a51d9a 100644
--- a/group
+++ b/group
@@ -307,3 +307,4 @@ atime
 200 mount auto quick
 201 metadata auto quick
 202 repair auto quick
+203 metadata rw auto
-- 
1.6.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] [XFSQA] Test writing to ENOSPC
  2009-03-15 10:49 [PATCH 0/3] [XFSQA] Optimisations and ENOSPC tests Dave Chinner
  2009-03-15 10:49 ` [PATCH 1/3] [XFSQA] Reduce the number of processes forked Dave Chinner
  2009-03-15 10:49 ` [PATCH 2/3] [XFSQA] Add simple delayed allocation ENOSPC test Dave Chinner
@ 2009-03-15 10:49 ` Dave Chinner
  2009-03-16  6:27   ` Christoph Hellwig
  2 siblings, 1 reply; 7+ messages in thread
From: Dave Chinner @ 2009-03-15 10:49 UTC (permalink / raw)
  To: xfs

Use larger files and different writing styles to fill
a 100MB filesystem to being full. In each case we should
get very close to the filesystem being full before getting
ENOSPC. THis tests different types of ENOSPC failures to
test 203 and requires more changes to pass.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 015           |   11 ---------
 204           |   66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 204.out       |    4 +++
 common.filter |   11 +++++++++
 group         |    1 +
 5 files changed, 82 insertions(+), 11 deletions(-)
 mode change 100644 => 100755 141
 mode change 100644 => 100755 164
 mode change 100644 => 100755 165
 mode change 100644 => 100755 166
 mode change 100644 => 100755 167
 mode change 100644 => 100755 170
 mode change 100644 => 100755 171
 mode change 100644 => 100755 172
 mode change 100644 => 100755 173
 mode change 100644 => 100755 174
 mode change 100644 => 100755 179
 mode change 100644 => 100755 180
 mode change 100644 => 100755 182
 mode change 100644 => 100755 183
 mode change 100644 => 100755 184
 mode change 100644 => 100755 185
 mode change 100644 => 100755 188
 mode change 100644 => 100755 189
 mode change 100644 => 100755 194
 mode change 100644 => 100755 195
 mode change 100644 => 100755 196
 mode change 100644 => 100755 197
 mode change 100644 => 100755 199
 mode change 100644 => 100755 200
 create mode 100755 204
 create mode 100644 204.out

diff --git a/015 b/015
index 9b78837..f999732 100755
--- a/015
+++ b/015
@@ -33,17 +33,6 @@ _free()
     _df_dir $SCRATCH_MNT | $AWK_PROG '{ print $5 }'
 }
 
-_filter_dd()
-{
-    $AWK_PROG '
-        /records in/                { next }
-        /records out/               { next }
-        /No space left on device/   { print "   !!! disk full (expected)" 
-                                      next }
-                                    { print "   *** " $0 }
-    '
-}
-
 # real QA test starts here
 _supported_fs xfs
 _supported_os IRIX Linux
diff --git a/141 b/141
old mode 100644
new mode 100755
diff --git a/164 b/164
old mode 100644
new mode 100755
diff --git a/165 b/165
old mode 100644
new mode 100755
diff --git a/166 b/166
old mode 100644
new mode 100755
diff --git a/167 b/167
old mode 100644
new mode 100755
diff --git a/170 b/170
old mode 100644
new mode 100755
diff --git a/171 b/171
old mode 100644
new mode 100755
diff --git a/172 b/172
old mode 100644
new mode 100755
diff --git a/173 b/173
old mode 100644
new mode 100755
diff --git a/174 b/174
old mode 100644
new mode 100755
diff --git a/179 b/179
old mode 100644
new mode 100755
diff --git a/180 b/180
old mode 100644
new mode 100755
diff --git a/182 b/182
old mode 100644
new mode 100755
diff --git a/183 b/183
old mode 100644
new mode 100755
diff --git a/184 b/184
old mode 100644
new mode 100755
diff --git a/185 b/185
old mode 100644
new mode 100755
diff --git a/188 b/188
old mode 100644
new mode 100755
diff --git a/189 b/189
old mode 100644
new mode 100755
diff --git a/194 b/194
old mode 100644
new mode 100755
diff --git a/195 b/195
old mode 100644
new mode 100755
diff --git a/196 b/196
old mode 100644
new mode 100755
diff --git a/197 b/197
old mode 100644
new mode 100755
diff --git a/199 b/199
old mode 100644
new mode 100755
diff --git a/200 b/200
old mode 100644
new mode 100755
diff --git a/204 b/204
new file mode 100755
index 0000000..2a0b94e
--- /dev/null
+++ b/204
@@ -0,0 +1,66 @@
+#! /bin/sh
+# FS QA Test No. 203
+#
+# Test out ENOSPC flushiung on small filesystems.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2009 Dave Chinner
+#-----------------------------------------------------------------------
+#
+# creator
+owner=david@fromorbit.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+
+_require_scratch
+
+_scratch_mkfs_xfs -d size=16m -b size=512 >/dev/null
+_scratch_mount
+
+# on a 16MB filesystem, there's 32768x512byte blocks. used is:
+#	- 4944 in the log,
+#	- 32+1 for the root inode cluster
+#	- 4 for the AG header
+#	- 2 for free space btrees
+#	- 4 for the AGFL
+#	- min(%5, 1024) = 1024 blocks for the reserve pool
+#	- about 15 blocks I can't account for right now.
+# That leaves ~26,745 blocks free to use.
+#
+# Writing the following three files fill the fs almost exactly.
+#
+# $ df -k /mnt/scratch
+# Filesystem           1K-blocks      Used Available Use% Mounted on
+# /dev/ubdc                13912     13908         4 100% /mnt/scratch
+#
+dd if=/dev/zero of=$SCRATCH_MNT/fred bs=512 count=25000 2>&1 | _filter_dd
+dd if=/dev/zero of=$SCRATCH_MNT/fred2 bs=512 count=500 2>&1 | _filter_dd
+dd if=/dev/zero of=$SCRATCH_MNT/fred3 bs=512 count=245 2>&1 | _filter_dd
+rm -f $SCRATCH_MNT/fred*
+
+echo "*** one file"
+# now try a single file of that size
+dd if=/dev/zero of=$SCRATCH_MNT/fred bs=512 count=26745 2>&1 | _filter_dd
+#rm -f $SCRATCH_MNT/fred*
+
+echo "*** one file, a few bytes at a time"
+# now try a single file of that size
+dd if=/dev/zero of=$SCRATCH_MNT/fred bs=15 count=$[26745/15*512] 2>&1 | _filter_dd
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/204.out b/204.out
new file mode 100644
index 0000000..0962619
--- /dev/null
+++ b/204.out
@@ -0,0 +1,4 @@
+QA output created by 204
+*** one file
+*** one file, a few bytes at a time
+*** done
diff --git a/common.filter b/common.filter
index d1d4cb5..0e2d7ff 100644
--- a/common.filter
+++ b/common.filter
@@ -167,5 +167,16 @@ _filter_growfs()
     }'
 }
 
+_filter_dd()
+{
+    $AWK_PROG '
+        /records in/                { next }
+        /records out/               { next }
+        /No space left on device/   { print "   !!! disk full (expected)" 
+                                      next }
+                                    { print "   *** " $0 }
+    '
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 0a51d9a..63c4dad 100644
--- a/group
+++ b/group
@@ -308,3 +308,4 @@ atime
 201 metadata auto quick
 202 repair auto quick
 203 metadata rw auto
+204 metadata rw auto
-- 
1.6.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] [XFSQA] Reduce the number of processes forked
  2009-03-15 10:49 ` [PATCH 1/3] [XFSQA] Reduce the number of processes forked Dave Chinner
@ 2009-03-16  6:23   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2009-03-16  6:23 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Sun, Mar 15, 2009 at 09:49:39PM +1100, Dave Chinner wrote:
> One of the big cpu time consumers when running xfsqa on UML
> is forking of new processes. when looping lots of times,
> using 'expr' to calculate the loop counter increment means
> we fork at least once every loop. using shell builtins means
> that we don't fork and many tests run substantially faster.
> 
> Some tests are even runnable with this modification. e.g. 110
> went from taking 4500s to run down to 9s with the loop iterators
> changed to avoid forking.

Looks good.

Care to see if any tests should be added to the quick group after this?
The above 110 sounds like a candidate for that.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] [XFSQA] Add simple delayed allocation ENOSPC test.
  2009-03-15 10:49 ` [PATCH 2/3] [XFSQA] Add simple delayed allocation ENOSPC test Dave Chinner
@ 2009-03-16  6:23   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2009-03-16  6:23 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Sun, Mar 15, 2009 at 09:49:40PM +1100, Dave Chinner wrote:
> Using a small (100MB) filesystem and writing lots of
> single block files can result in spurious ENOSPCs
> being reported. Reproduce this test case so we can confirm
> that it gets fixed.

Looks good.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] [XFSQA] Test writing to ENOSPC
  2009-03-15 10:49 ` [PATCH 3/3] [XFSQA] Test writing to ENOSPC Dave Chinner
@ 2009-03-16  6:27   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2009-03-16  6:27 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Sun, Mar 15, 2009 at 09:49:41PM +1100, Dave Chinner wrote:
> Use larger files and different writing styles to fill
> a 100MB filesystem to being full. In each case we should
> get very close to the filesystem being full before getting
> ENOSPC. THis tests different types of ENOSPC failures to
> test 203 and requires more changes to pass.

Looks good.   But don't we actually need a trap handler to unmount the
scratch partitions if the test gets intterupted?  I always added them
to my tests, copying that fragment from older patches.  (also applies
to the previous patch)

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-16  6:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-15 10:49 [PATCH 0/3] [XFSQA] Optimisations and ENOSPC tests Dave Chinner
2009-03-15 10:49 ` [PATCH 1/3] [XFSQA] Reduce the number of processes forked Dave Chinner
2009-03-16  6:23   ` Christoph Hellwig
2009-03-15 10:49 ` [PATCH 2/3] [XFSQA] Add simple delayed allocation ENOSPC test Dave Chinner
2009-03-16  6:23   ` Christoph Hellwig
2009-03-15 10:49 ` [PATCH 3/3] [XFSQA] Test writing to ENOSPC Dave Chinner
2009-03-16  6:27   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox