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