All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: regression test for ext4 resize with non-extent files
@ 2013-05-09 22:02 ` Eric Sandeen
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2013-05-09 22:02 UTC (permalink / raw)
  To: xfs-oss; +Cc: ext4 development

Regression test for:

c5c72d8 ext4: fix online resizing for ext3-compat file systems

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tests/ext4/306 b/tests/ext4/306
new file mode 100755
index 0000000..6a961ee
--- /dev/null
+++ b/tests/ext4/306
@@ -0,0 +1,83 @@
+#! /bin/bash
+# FS QA Test No. ext4/306
+#
+# Test that blocks are available to non-extent files after a resize2fs
+# Regression test for commit:
+# c5c72d8 ext4: fix online resizing for ext3-compat file systems
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+PIDS=""
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    _scratch_unmount
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs ext4
+_supported_os Linux
+
+_require_scratch
+
+# This needs to mount ext3; might require ext3 driver, or ext4
+# might handle it itself.  Find out if we have it one way or another.
+modprobe ext3 > /dev/null 2>&1
+grep -q ext3 /proc/filesystems || _notrun "This test requires ext3 support"
+
+rm -f $seqres.full
+echo "Silence is golden"
+
+# Make a small ext3 fs, (extents disabled) & mount it
+yes | mkfs.ext3 $SCRATCH_DEV 512m >> $seqres.full 2>&1
+_scratch_mount -t ext3 || _fail "couldn't mount fs as ext3"
+# Create a small non-extent-based file
+echo "Create 1m testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io
+echo "Create testfile2 to fill the fs"
+# A large non-extent-based file filling the fs; this will run out & fail
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io
+
+# Remount as ext4
+_scratch_unmount
+_scratch_mount -t ext4 || _fail "couldn't remount fs as ext4"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# Grow it by 512m
+echo "Resize to 1g"
+resize2fs $SCRATCH_DEV 1g >> $seqres.full 2>&1 || _fail "Could not resize to 1g"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# See if we can add more blocks to the files
+echo "append 2m to testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 1m 2m" | _filter_xfs_io
+echo "append 2m to testfile2"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 512m 2m" | _filter_xfs_io
+
+status=0
+exit
diff --git a/tests/ext4/306.out b/tests/ext4/306.out
new file mode 100644
index 0000000..654637d
--- /dev/null
+++ b/tests/ext4/306.out
@@ -0,0 +1,14 @@
+QA output created by 306
+Silence is golden
+Create 1m testfile1
+wrote 1048576/1048576 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Create testfile2 to fill the fs
+pwrite64: No space left on device
+Resize to 1g
+append 2m to testfile1
+wrote 2097152/2097152 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+append 2m to testfile2
+wrote 2097152/2097152 bytes at offset 536870912
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/ext4/group b/tests/ext4/group
index 53af708..4c3e2f4 100644
--- a/tests/ext4/group
+++ b/tests/ext4/group
@@ -9,3 +9,4 @@
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 auto
+306 dangerous rw resize quick


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

* [PATCH] xfstests: regression test for ext4 resize with non-extent files
@ 2013-05-09 22:02 ` Eric Sandeen
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2013-05-09 22:02 UTC (permalink / raw)
  To: xfs-oss; +Cc: ext4 development

Regression test for:

c5c72d8 ext4: fix online resizing for ext3-compat file systems

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tests/ext4/306 b/tests/ext4/306
new file mode 100755
index 0000000..6a961ee
--- /dev/null
+++ b/tests/ext4/306
@@ -0,0 +1,83 @@
+#! /bin/bash
+# FS QA Test No. ext4/306
+#
+# Test that blocks are available to non-extent files after a resize2fs
+# Regression test for commit:
+# c5c72d8 ext4: fix online resizing for ext3-compat file systems
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+PIDS=""
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    _scratch_unmount
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs ext4
+_supported_os Linux
+
+_require_scratch
+
+# This needs to mount ext3; might require ext3 driver, or ext4
+# might handle it itself.  Find out if we have it one way or another.
+modprobe ext3 > /dev/null 2>&1
+grep -q ext3 /proc/filesystems || _notrun "This test requires ext3 support"
+
+rm -f $seqres.full
+echo "Silence is golden"
+
+# Make a small ext3 fs, (extents disabled) & mount it
+yes | mkfs.ext3 $SCRATCH_DEV 512m >> $seqres.full 2>&1
+_scratch_mount -t ext3 || _fail "couldn't mount fs as ext3"
+# Create a small non-extent-based file
+echo "Create 1m testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io
+echo "Create testfile2 to fill the fs"
+# A large non-extent-based file filling the fs; this will run out & fail
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io
+
+# Remount as ext4
+_scratch_unmount
+_scratch_mount -t ext4 || _fail "couldn't remount fs as ext4"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# Grow it by 512m
+echo "Resize to 1g"
+resize2fs $SCRATCH_DEV 1g >> $seqres.full 2>&1 || _fail "Could not resize to 1g"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# See if we can add more blocks to the files
+echo "append 2m to testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 1m 2m" | _filter_xfs_io
+echo "append 2m to testfile2"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 512m 2m" | _filter_xfs_io
+
+status=0
+exit
diff --git a/tests/ext4/306.out b/tests/ext4/306.out
new file mode 100644
index 0000000..654637d
--- /dev/null
+++ b/tests/ext4/306.out
@@ -0,0 +1,14 @@
+QA output created by 306
+Silence is golden
+Create 1m testfile1
+wrote 1048576/1048576 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Create testfile2 to fill the fs
+pwrite64: No space left on device
+Resize to 1g
+append 2m to testfile1
+wrote 2097152/2097152 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+append 2m to testfile2
+wrote 2097152/2097152 bytes at offset 536870912
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/ext4/group b/tests/ext4/group
index 53af708..4c3e2f4 100644
--- a/tests/ext4/group
+++ b/tests/ext4/group
@@ -9,3 +9,4 @@
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 auto
+306 dangerous rw resize quick

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

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

* Re: [PATCH] xfstests: regression test for ext4 resize with non-extent files
  2013-05-09 22:02 ` Eric Sandeen
  (?)
@ 2013-05-10  3:03 ` Eryu Guan
  2013-05-10  3:05   ` Eric Sandeen
  -1 siblings, 1 reply; 9+ messages in thread
From: Eryu Guan @ 2013-05-10  3:03 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, xfs-oss


[-- Attachment #1.1: Type: text/plain, Size: 4797 bytes --]

On Fri, May 10, 2013 at 6:02 AM, Eric Sandeen <sandeen@redhat.com> wrote:

> Regression test for:
>
> c5c72d8 ext4: fix online resizing for ext3-compat file systems
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> diff --git a/tests/ext4/306 b/tests/ext4/306
> new file mode 100755
> index 0000000..6a961ee
> --- /dev/null
> +++ b/tests/ext4/306
> @@ -0,0 +1,83 @@
> +#! /bin/bash
> +# FS QA Test No. ext4/306
> +#
> +# Test that blocks are available to non-extent files after a resize2fs
> +# Regression test for commit:
> +# c5c72d8 ext4: fix online resizing for ext3-compat file systems
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +PIDS=""
> +status=1       # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +    _scratch_unmount
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs ext4
> +_supported_os Linux
> +
> +_require_scratch
> +
> +# This needs to mount ext3; might require ext3 driver, or ext4
> +# might handle it itself.  Find out if we have it one way or another.
> +modprobe ext3 > /dev/null 2>&1
> +grep -q ext3 /proc/filesystems || _notrun "This test requires ext3
> support"
> +
> +rm -f $seqres.full
> +echo "Silence is golden"
>

The test has verbose output log, so "Silence is golden" is not true here,
remove this line or redirect other echo to $seqres.full ?

> +
> +# Make a small ext3 fs, (extents disabled) & mount it
> +yes | mkfs.ext3 $SCRATCH_DEV 512m >> $seqres.full 2>&1
> +_scratch_mount -t ext3 || _fail "couldn't mount fs as ext3"
> +# Create a small non-extent-based file
> +echo "Create 1m testfile1"
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io
> +echo "Create testfile2 to fill the fs"
> +# A large non-extent-based file filling the fs; this will run out & fail
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io
> +
> +# Remount as ext4
> +_scratch_unmount
> +_scratch_mount -t ext4 || _fail "couldn't remount fs as ext4"
> +df -h $SCRATCH_MNT >> $seqres.full
> +
> +# Grow it by 512m
> +echo "Resize to 1g"
> +resize2fs $SCRATCH_DEV 1g >> $seqres.full 2>&1 || _fail "Could not resize
> to 1g"
> +df -h $SCRATCH_MNT >> $seqres.full
> +
> +# See if we can add more blocks to the files
> +echo "append 2m to testfile1"
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 1m 2m" | _filter_xfs_io
> +echo "append 2m to testfile2"
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 512m 2m" |
> _filter_xfs_io
> +
> +status=0
> +exit
> diff --git a/tests/ext4/306.out b/tests/ext4/306.out
> new file mode 100644
> index 0000000..654637d
> --- /dev/null
> +++ b/tests/ext4/306.out
> @@ -0,0 +1,14 @@
> +QA output created by 306
> +Silence is golden
> +Create 1m testfile1
> +wrote 1048576/1048576 bytes at offset 0
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +Create testfile2 to fill the fs
> +pwrite64: No space left on device
> +Resize to 1g
> +append 2m to testfile1
> +wrote 2097152/2097152 bytes at offset 1048576
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +append 2m to testfile2
> +wrote 2097152/2097152 bytes at offset 536870912
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> diff --git a/tests/ext4/group b/tests/ext4/group
> index 53af708..4c3e2f4 100644
> --- a/tests/ext4/group
> +++ b/tests/ext4/group
> @@ -9,3 +9,4 @@
>  303 aio dangerous ioctl rw stress
>  304 aio dangerous ioctl rw stress
>  305 auto
> +306 dangerous rw resize quick
>

I'm wondering why it's not in auto group :)

Otherwise patch looks good to me.

Eryu Guan

>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

[-- Attachment #1.2: Type: text/html, Size: 6197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

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

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

* Re: [PATCH] xfstests: regression test for ext4 resize with non-extent files
  2013-05-10  3:03 ` Eryu Guan
@ 2013-05-10  3:05   ` Eric Sandeen
  2013-05-10  4:55       ` Dave Chinner
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Sandeen @ 2013-05-10  3:05 UTC (permalink / raw)
  To: guaneryu; +Cc: ext4 development, xfs-oss

On 5/9/13 10:03 PM, Eryu Guan wrote:
> On Fri, May 10, 2013 at 6:02 AM, Eric Sandeen <sandeen@redhat.com <mailto:sandeen@redhat.com>> wrote:
> 

...

>     index 53af708..4c3e2f4 100644
>     --- a/tests/ext4/group
>     +++ b/tests/ext4/group
>     @@ -9,3 +9,4 @@
>      303 aio dangerous ioctl rw stress
>      304 aio dangerous ioctl rw stress
>      305 auto
>     +306 dangerous rw resize quick
> 
> 
> I'm wondering why it's not in auto group :)


because I forgot about auto! :)

But it's also somewhat dangerous; it could oops or hang, so perhaps
auto is not a good idea.

-Eric


> Otherwise patch looks good to me.
> 
> Eryu Guan

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

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

* Re: [PATCH] xfstests: regression test for ext4 resize with non-extent files
  2013-05-10  3:05   ` Eric Sandeen
@ 2013-05-10  4:55       ` Dave Chinner
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2013-05-10  4:55 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: guaneryu, ext4 development, xfs-oss

On Thu, May 09, 2013 at 10:05:56PM -0500, Eric Sandeen wrote:
> On 5/9/13 10:03 PM, Eryu Guan wrote:
> > On Fri, May 10, 2013 at 6:02 AM, Eric Sandeen <sandeen@redhat.com <mailto:sandeen@redhat.com>> wrote:
> > 
> 
> ...
> 
> >     index 53af708..4c3e2f4 100644
> >     --- a/tests/ext4/group
> >     +++ b/tests/ext4/group
> >     @@ -9,3 +9,4 @@
> >      303 aio dangerous ioctl rw stress
> >      304 aio dangerous ioctl rw stress
> >      305 auto
> >     +306 dangerous rw resize quick
> > 
> > 
> > I'm wondering why it's not in auto group :)
> 
> 
> because I forgot about auto! :)
> 
> But it's also somewhat dangerous; it could oops or hang, so perhaps
> auto is not a good idea.

If the bug has already been fixed, then auto rather than dangerous
should be used. If the hang/panic cannot be fixed, or is going to
take some time to be fixed, that's when dangerous should be used.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [PATCH] xfstests: regression test for ext4 resize with non-extent files
@ 2013-05-10  4:55       ` Dave Chinner
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2013-05-10  4:55 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, guaneryu, xfs-oss

On Thu, May 09, 2013 at 10:05:56PM -0500, Eric Sandeen wrote:
> On 5/9/13 10:03 PM, Eryu Guan wrote:
> > On Fri, May 10, 2013 at 6:02 AM, Eric Sandeen <sandeen@redhat.com <mailto:sandeen@redhat.com>> wrote:
> > 
> 
> ...
> 
> >     index 53af708..4c3e2f4 100644
> >     --- a/tests/ext4/group
> >     +++ b/tests/ext4/group
> >     @@ -9,3 +9,4 @@
> >      303 aio dangerous ioctl rw stress
> >      304 aio dangerous ioctl rw stress
> >      305 auto
> >     +306 dangerous rw resize quick
> > 
> > 
> > I'm wondering why it's not in auto group :)
> 
> 
> because I forgot about auto! :)
> 
> But it's also somewhat dangerous; it could oops or hang, so perhaps
> auto is not a good idea.

If the bug has already been fixed, then auto rather than dangerous
should be used. If the hang/panic cannot be fixed, or is going to
take some time to be fixed, that's when dangerous should be used.

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] 9+ messages in thread

* [PATCH V2] xfstests: regression test for ext4 resize with non-extent files
  2013-05-09 22:02 ` Eric Sandeen
@ 2013-05-10 13:23   ` Eric Sandeen
  -1 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2013-05-10 13:23 UTC (permalink / raw)
  To: xfs-oss; +Cc: ext4 development

Regression test for:

c5c72d8 ext4: fix online resizing for ext3-compat file systems

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: s/dangerous/auto/

good luck!

diff --git a/tests/ext4/306 b/tests/ext4/306
new file mode 100755
index 0000000..6a961ee
--- /dev/null
+++ b/tests/ext4/306
@@ -0,0 +1,83 @@
+#! /bin/bash
+# FS QA Test No. ext4/306
+#
+# Test that blocks are available to non-extent files after a resize2fs
+# Regression test for commit:
+# c5c72d8 ext4: fix online resizing for ext3-compat file systems
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+PIDS=""
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    _scratch_unmount
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs ext4
+_supported_os Linux
+
+_require_scratch
+
+# This needs to mount ext3; might require ext3 driver, or ext4
+# might handle it itself.  Find out if we have it one way or another.
+modprobe ext3 > /dev/null 2>&1
+grep -q ext3 /proc/filesystems || _notrun "This test requires ext3 support"
+
+rm -f $seqres.full
+echo "Silence is golden"
+
+# Make a small ext3 fs, (extents disabled) & mount it
+yes | mkfs.ext3 $SCRATCH_DEV 512m >> $seqres.full 2>&1
+_scratch_mount -t ext3 || _fail "couldn't mount fs as ext3"
+# Create a small non-extent-based file
+echo "Create 1m testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io
+echo "Create testfile2 to fill the fs"
+# A large non-extent-based file filling the fs; this will run out & fail
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io
+
+# Remount as ext4
+_scratch_unmount
+_scratch_mount -t ext4 || _fail "couldn't remount fs as ext4"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# Grow it by 512m
+echo "Resize to 1g"
+resize2fs $SCRATCH_DEV 1g >> $seqres.full 2>&1 || _fail "Could not resize to 1g"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# See if we can add more blocks to the files
+echo "append 2m to testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 1m 2m" | _filter_xfs_io
+echo "append 2m to testfile2"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 512m 2m" | _filter_xfs_io
+
+status=0
+exit
diff --git a/tests/ext4/306.out b/tests/ext4/306.out
new file mode 100644
index 0000000..654637d
--- /dev/null
+++ b/tests/ext4/306.out
@@ -0,0 +1,14 @@
+QA output created by 306
+Silence is golden
+Create 1m testfile1
+wrote 1048576/1048576 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Create testfile2 to fill the fs
+pwrite64: No space left on device
+Resize to 1g
+append 2m to testfile1
+wrote 2097152/2097152 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+append 2m to testfile2
+wrote 2097152/2097152 bytes at offset 536870912
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/ext4/group b/tests/ext4/group
index 53af708..4c3e2f4 100644
--- a/tests/ext4/group
+++ b/tests/ext4/group
@@ -9,3 +9,4 @@
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 auto
+306 auto rw resize quick


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

* [PATCH V2] xfstests: regression test for ext4 resize with non-extent files
@ 2013-05-10 13:23   ` Eric Sandeen
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2013-05-10 13:23 UTC (permalink / raw)
  To: xfs-oss; +Cc: ext4 development

Regression test for:

c5c72d8 ext4: fix online resizing for ext3-compat file systems

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: s/dangerous/auto/

good luck!

diff --git a/tests/ext4/306 b/tests/ext4/306
new file mode 100755
index 0000000..6a961ee
--- /dev/null
+++ b/tests/ext4/306
@@ -0,0 +1,83 @@
+#! /bin/bash
+# FS QA Test No. ext4/306
+#
+# Test that blocks are available to non-extent files after a resize2fs
+# Regression test for commit:
+# c5c72d8 ext4: fix online resizing for ext3-compat file systems
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+PIDS=""
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    _scratch_unmount
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs ext4
+_supported_os Linux
+
+_require_scratch
+
+# This needs to mount ext3; might require ext3 driver, or ext4
+# might handle it itself.  Find out if we have it one way or another.
+modprobe ext3 > /dev/null 2>&1
+grep -q ext3 /proc/filesystems || _notrun "This test requires ext3 support"
+
+rm -f $seqres.full
+echo "Silence is golden"
+
+# Make a small ext3 fs, (extents disabled) & mount it
+yes | mkfs.ext3 $SCRATCH_DEV 512m >> $seqres.full 2>&1
+_scratch_mount -t ext3 || _fail "couldn't mount fs as ext3"
+# Create a small non-extent-based file
+echo "Create 1m testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io
+echo "Create testfile2 to fill the fs"
+# A large non-extent-based file filling the fs; this will run out & fail
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io
+
+# Remount as ext4
+_scratch_unmount
+_scratch_mount -t ext4 || _fail "couldn't remount fs as ext4"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# Grow it by 512m
+echo "Resize to 1g"
+resize2fs $SCRATCH_DEV 1g >> $seqres.full 2>&1 || _fail "Could not resize to 1g"
+df -h $SCRATCH_MNT >> $seqres.full
+
+# See if we can add more blocks to the files
+echo "append 2m to testfile1"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 1m 2m" | _filter_xfs_io
+echo "append 2m to testfile2"
+$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 512m 2m" | _filter_xfs_io
+
+status=0
+exit
diff --git a/tests/ext4/306.out b/tests/ext4/306.out
new file mode 100644
index 0000000..654637d
--- /dev/null
+++ b/tests/ext4/306.out
@@ -0,0 +1,14 @@
+QA output created by 306
+Silence is golden
+Create 1m testfile1
+wrote 1048576/1048576 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Create testfile2 to fill the fs
+pwrite64: No space left on device
+Resize to 1g
+append 2m to testfile1
+wrote 2097152/2097152 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+append 2m to testfile2
+wrote 2097152/2097152 bytes at offset 536870912
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/ext4/group b/tests/ext4/group
index 53af708..4c3e2f4 100644
--- a/tests/ext4/group
+++ b/tests/ext4/group
@@ -9,3 +9,4 @@
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 auto
+306 auto rw resize quick

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

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

* Re: [PATCH V2] xfstests: regression test for ext4 resize with non-extent files
  2013-05-10 13:23   ` Eric Sandeen
  (?)
@ 2013-05-14 10:00   ` Eryu Guan
  -1 siblings, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2013-05-14 10:00 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, xfs-oss


[-- Attachment #1.1: Type: text/plain, Size: 4671 bytes --]

On Fri, May 10, 2013 at 9:23 PM, Eric Sandeen <sandeen@redhat.com> wrote:

> Regression test for:
>
> c5c72d8 ext4: fix online resizing for ext3-compat file systems
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> V2: s/dangerous/auto/
>
> good luck!
>
> diff --git a/tests/ext4/306 b/tests/ext4/306
> new file mode 100755
> index 0000000..6a961ee
> --- /dev/null
> +++ b/tests/ext4/306
> @@ -0,0 +1,83 @@
> +#! /bin/bash
> +# FS QA Test No. ext4/306
> +#
> +# Test that blocks are available to non-extent files after a resize2fs
> +# Regression test for commit:
> +# c5c72d8 ext4: fix online resizing for ext3-compat file systems
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +PIDS=""
> +status=1       # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +    _scratch_unmount
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs ext4
> +_supported_os Linux
> +
> +_require_scratch
> +
> +# This needs to mount ext3; might require ext3 driver, or ext4
> +# might handle it itself.  Find out if we have it one way or another.
> +modprobe ext3 > /dev/null 2>&1
> +grep -q ext3 /proc/filesystems || _notrun "This test requires ext3
> support"
> +
> +rm -f $seqres.full
> +echo "Silence is golden"
>

Is the "Silence is golden" output still needed? I see that it's not
"silence" in 306.out

Otherwise looks good to me.

Thanks,
Eryu Guan

> +
> +# Make a small ext3 fs, (extents disabled) & mount it
> +yes | mkfs.ext3 $SCRATCH_DEV 512m >> $seqres.full 2>&1
> +_scratch_mount -t ext3 || _fail "couldn't mount fs as ext3"
> +# Create a small non-extent-based file
> +echo "Create 1m testfile1"
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 0 1m" | _filter_xfs_io
> +echo "Create testfile2 to fill the fs"
> +# A large non-extent-based file filling the fs; this will run out & fail
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile2 -c "pwrite 0 512m" | _filter_xfs_io
> +
> +# Remount as ext4
> +_scratch_unmount
> +_scratch_mount -t ext4 || _fail "couldn't remount fs as ext4"
> +df -h $SCRATCH_MNT >> $seqres.full
> +
> +# Grow it by 512m
> +echo "Resize to 1g"
> +resize2fs $SCRATCH_DEV 1g >> $seqres.full 2>&1 || _fail "Could not resize
> to 1g"
> +df -h $SCRATCH_MNT >> $seqres.full
> +
> +# See if we can add more blocks to the files
> +echo "append 2m to testfile1"
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 1m 2m" | _filter_xfs_io
> +echo "append 2m to testfile2"
> +$XFS_IO_PROG -f $SCRATCH_MNT/testfile1 -c "pwrite 512m 2m" |
> _filter_xfs_io
> +
> +status=0
> +exit
> diff --git a/tests/ext4/306.out b/tests/ext4/306.out
> new file mode 100644
> index 0000000..654637d
> --- /dev/null
> +++ b/tests/ext4/306.out
> @@ -0,0 +1,14 @@
> +QA output created by 306
> +Silence is golden
> +Create 1m testfile1
> +wrote 1048576/1048576 bytes at offset 0
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +Create testfile2 to fill the fs
> +pwrite64: No space left on device
> +Resize to 1g
> +append 2m to testfile1
> +wrote 2097152/2097152 bytes at offset 1048576
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +append 2m to testfile2
> +wrote 2097152/2097152 bytes at offset 536870912
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> diff --git a/tests/ext4/group b/tests/ext4/group
> index 53af708..4c3e2f4 100644
> --- a/tests/ext4/group
> +++ b/tests/ext4/group
> @@ -9,3 +9,4 @@
>  303 aio dangerous ioctl rw stress
>  304 aio dangerous ioctl rw stress
>  305 auto
> +306 auto rw resize quick
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>

[-- Attachment #1.2: Type: text/html, Size: 6013 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

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

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

end of thread, other threads:[~2013-05-14 10:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-09 22:02 [PATCH] xfstests: regression test for ext4 resize with non-extent files Eric Sandeen
2013-05-09 22:02 ` Eric Sandeen
2013-05-10  3:03 ` Eryu Guan
2013-05-10  3:05   ` Eric Sandeen
2013-05-10  4:55     ` Dave Chinner
2013-05-10  4:55       ` Dave Chinner
2013-05-10 13:23 ` [PATCH V2] " Eric Sandeen
2013-05-10 13:23   ` Eric Sandeen
2013-05-14 10:00   ` Eryu Guan

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.