All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfsqa: define resblks for tests near ENOSPC
@ 2010-03-04  1:47 Dave Chinner
  2010-03-04 13:56 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2010-03-04  1:47 UTC (permalink / raw)
  To: xfs

Several tests assume a certain amount of disk space free after the
reserve block pool is filled. Changing the default size of the
reserve block pool breaks these tests because there is less space
available that first thought.

Change these tests to specify a known reserve block pool size of
1024 blocks to ensure that they continue to work correctly even if
the default size changes.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 104 |    4 ++++
 204 |    4 ++++
 205 |    4 ++++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/104 b/104
index b35c43b..c119822 100755
--- a/104
+++ b/104
@@ -48,6 +48,10 @@ _create_scratch()
 		echo "failed to mount $SCRATCH_DEV"
 		exit 1
 	fi
+
+	# fix the reserve block pool to a known size so that the enospc
+	# calculations work out correctly.
+	xfs_io -x -c "resblks 1024" $SCRATCH_MNT > /dev/null 2>&1
 }
 
 _fill_scratch()
diff --git a/204 b/204
index 8b94f60..3abe794 100755
--- a/204
+++ b/204
@@ -44,6 +44,10 @@ SIZE=`expr 104 \* 1024 \* 1024`
 _scratch_mkfs_sized $SIZE  &> /dev/null
 _scratch_mount
 
+# fix the reserve block pool to a known size so that the enospc calculations
+# work out correctly.
+xfs_io -x -c "resblks 1024" $SCRATCH_MNT >> $seq.full 2>&1
+
 for i in `seq 1 22500`; do
     echo -n > $SCRATCH_MNT/$i
     echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
diff --git a/205 b/205
index 3f45185..5487ea4 100755
--- a/205
+++ b/205
@@ -43,6 +43,10 @@ _require_scratch
 _scratch_mkfs_xfs -d size=16m -b size=512 >/dev/null
 _scratch_mount
 
+# fix the reserve block pool to a known size so that the enospc calculations
+# work out correctly.
+xfs_io -x -c "resblks 1024" $SCRATCH_MNT >> $seq.full 2>&1
+
 # on a 16MB filesystem, there's 32768x512byte blocks. used is:
 #	- 4944 in the log,
 #	- 32+1 for the root inode cluster
-- 
1.6.5

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

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

* Re: [PATCH] xfsqa: define resblks for tests near ENOSPC
  2010-03-04  1:47 [PATCH] xfsqa: define resblks for tests near ENOSPC Dave Chinner
@ 2010-03-04 13:56 ` Christoph Hellwig
  2010-03-04 22:04   ` Dave Chinner
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2010-03-04 13:56 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Thu, Mar 04, 2010 at 12:47:34PM +1100, Dave Chinner wrote:
> +	# fix the reserve block pool to a known size so that the enospc
> +	# calculations work out correctly.
> +	xfs_io -x -c "resblks 1024" $SCRATCH_MNT > /dev/null 2>&1

What about a _scratch_resvblks helper - that means we could also
add noops for non-xfs filesystems there easily.

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

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

* Re: [PATCH] xfsqa: define resblks for tests near ENOSPC
  2010-03-04 13:56 ` Christoph Hellwig
@ 2010-03-04 22:04   ` Dave Chinner
  2010-03-05  2:03     ` [PATCH v2] " Dave Chinner
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2010-03-04 22:04 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Mar 04, 2010 at 08:56:23AM -0500, Christoph Hellwig wrote:
> On Thu, Mar 04, 2010 at 12:47:34PM +1100, Dave Chinner wrote:
> > +	# fix the reserve block pool to a known size so that the enospc
> > +	# calculations work out correctly.
> > +	xfs_io -x -c "resblks 1024" $SCRATCH_MNT > /dev/null 2>&1
> 
> What about a _scratch_resvblks helper - that means we could also
> add noops for non-xfs filesystems there easily.

Good idea. I'll rework the patch to do this.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

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

* [PATCH v2] xfsqa: define resblks for tests near ENOSPC
  2010-03-04 22:04   ` Dave Chinner
@ 2010-03-05  2:03     ` Dave Chinner
  2010-03-05  9:21       ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2010-03-05  2:03 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs


Several tests assume a certain amount of disk space free after the
reserve block pool is filled. Changing the default size of the
reserve block pool breaks these tests because there is less space
available that first thought.

Change these tests to specify a known reserve block pool size of
1024 blocks to ensure that they continue to work correctly even if
the default size changes.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 104       |    4 ++++
 204       |    4 ++++
 205       |    4 ++++
 common.rc |   11 +++++++++++
 4 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/104 b/104
index b35c43b..14f2669 100755
--- a/104
+++ b/104
@@ -48,6 +48,10 @@ _create_scratch()
 		echo "failed to mount $SCRATCH_DEV"
 		exit 1
 	fi
+
+	# fix the reserve block pool to a known size so that the enospc
+	# calculations work out correctly.
+	_scratch_resvblks 1024 >  /dev/null 2>&1
 }
 
 _fill_scratch()
diff --git a/204 b/204
index 8b94f60..9f4839c 100755
--- a/204
+++ b/204
@@ -44,6 +44,10 @@ SIZE=`expr 104 \* 1024 \* 1024`
 _scratch_mkfs_sized $SIZE  &> /dev/null
 _scratch_mount
 
+# fix the reserve block pool to a known size so that the enospc calculations
+# work out correctly.
+_scratch_resvblks 1024 > $seq.full 2>&1
+
 for i in `seq 1 22500`; do
     echo -n > $SCRATCH_MNT/$i
     echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
diff --git a/205 b/205
index 3f45185..35d6992 100755
--- a/205
+++ b/205
@@ -43,6 +43,10 @@ _require_scratch
 _scratch_mkfs_xfs -d size=16m -b size=512 >/dev/null
 _scratch_mount
 
+# fix the reserve block pool to a known size so that the enospc calculations
+# work out correctly.
+_scratch_resvblks 1024 > $seq.full 2>&1
+
 # on a 16MB filesystem, there's 32768x512byte blocks. used is:
 #	- 4944 in the log,
 #	- 32+1 for the root inode cluster
diff --git a/common.rc b/common.rc
index d71e0a2..2103a77 100644
--- a/common.rc
+++ b/common.rc
@@ -361,6 +361,17 @@ _scratch_mkfs_geom()
     _scratch_mkfs
 }
 
+_scratch_resvblks()
+{
+	case $FSTYP in
+	xfs)
+		xfs_io -x -c "resblks $1" $SCRATCH_MNT
+		;;
+	*)
+		;;
+	esac
+}
+
 _scratch_xfs_db_options()
 {
     SCRATCH_OPTIONS=""

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

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

* Re: [PATCH v2] xfsqa: define resblks for tests near ENOSPC
  2010-03-05  2:03     ` [PATCH v2] " Dave Chinner
@ 2010-03-05  9:21       ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2010-03-05  9:21 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Christoph Hellwig, xfs

On Fri, Mar 05, 2010 at 01:03:33PM +1100, Dave Chinner wrote:
> 
> Several tests assume a certain amount of disk space free after the
> reserve block pool is filled. Changing the default size of the
> reserve block pool breaks these tests because there is less space
> available that first thought.
> 
> Change these tests to specify a known reserve block pool size of
> 1024 blocks to ensure that they continue to work correctly even if
> the default size changes.

Looks good,


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

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

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

end of thread, other threads:[~2010-03-05  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-04  1:47 [PATCH] xfsqa: define resblks for tests near ENOSPC Dave Chinner
2010-03-04 13:56 ` Christoph Hellwig
2010-03-04 22:04   ` Dave Chinner
2010-03-05  2:03     ` [PATCH v2] " Dave Chinner
2010-03-05  9:21       ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.