linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors
@ 2015-03-17 17:32 Jaegeuk Kim
  2015-03-17 17:32 ` [PATCH 2/2] f2fs/001: introduce a testcaes for -ENOSPC with inline operation Jaegeuk Kim
  2015-03-18  3:46 ` [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors Dave Chinner
  0 siblings, 2 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2015-03-17 17:32 UTC (permalink / raw)
  To: Dave Chinner; +Cc: fstests, linux-f2fs-devel, Jaegeuk Kim

This patch introduces a new testcase, generic/067, to test several truncation
cases under the inline feature supported by filesystems.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 tests/generic/067     | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/067.out |  41 ++++++++++++++++++
 tests/generic/group   |   1 +
 3 files changed, 156 insertions(+)
 create mode 100755 tests/generic/067
 create mode 100644 tests/generic/067.out

diff --git a/tests/generic/067 b/tests/generic/067
new file mode 100755
index 0000000..97f34b6
--- /dev/null
+++ b/tests/generic/067
@@ -0,0 +1,114 @@
+#! /bin/bash
+# FS QA Test No. generic/067
+#
+# Test small truncation to check inline operations.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2014 Jaegeuk Kim.  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"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+
+testfile=$SCRATCH_MNT/testfile
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+
+# aligned inline truncation
+$XFS_IO_PROG -t -f \
+-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
+-c "fsync"	\
+-c "truncate 0"                 `# truncate     |                        |` \
+-c "truncate 160"               `# truncate     |                        |` \
+-c "close"      \
+$testfile | _filter_xfs_io
+
+echo "==== aligned inline truncation ==="
+hexdump -C $testfile
+_scratch_remount
+hexdump -C $testfile
+rm $testfile
+
+# aligned out-of-inline truncation
+$XFS_IO_PROG -t -f \
+-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
+-c "fsync"	\
+-c "truncate 0"                 `# truncate     |                        |` \
+-c "truncate 8192"              `# truncate     |                        |` \
+-c "close"      \
+$testfile | _filter_xfs_io
+
+echo "==== aligned out-of-inline truncation ==="
+hexdump -C $testfile
+_scratch_remount
+hexdump -C $testfile
+rm $testfile
+
+# unaligned inline truncation
+$XFS_IO_PROG -t -f \
+-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
+-c "fsync"	\
+-c "truncate 4"                 `# truncate     |XXXX                    |` \
+-c "truncate 160"               `# truncate     |XXXX                    |` \
+-c "close"      \
+$testfile | _filter_xfs_io
+
+echo "==== unaligned inline truncation ==="
+hexdump -C $testfile
+_scratch_remount
+hexdump -C $testfile
+rm $testfile
+
+# unaligned out-of-inline truncation
+$XFS_IO_PROG -t -f \
+-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
+-c "fsync"	\
+-c "truncate 4"                 `# truncate     |XXXX                    |` \
+-c "truncate 8192"              `# truncate     |XXXX                    |` \
+-c "close"      \
+$testfile | _filter_xfs_io
+
+echo "==== unaligned out-of-inline truncation ==="
+hexdump -C $testfile
+_scratch_remount
+hexdump -C $testfile
+rm $testfile
+
+status=0
+exit
+
diff --git a/tests/generic/067.out b/tests/generic/067.out
new file mode 100644
index 0000000..4cef439
--- /dev/null
+++ b/tests/generic/067.out
@@ -0,0 +1,41 @@
+QA output created by 067
+wrote 120/120 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+==== aligned inline truncation ===
+00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+000000a0
+00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+000000a0
+wrote 120/120 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+==== aligned out-of-inline truncation ===
+00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00002000
+00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00002000
+wrote 120/120 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+==== unaligned inline truncation ===
+00000000  58 58 58 58 00 00 00 00  00 00 00 00 00 00 00 00  |XXXX............|
+00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+000000a0
+00000000  58 58 58 58 00 00 00 00  00 00 00 00 00 00 00 00  |XXXX............|
+00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+000000a0
+wrote 120/120 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+==== unaligned out-of-inline truncation ===
+00000000  58 58 58 58 00 00 00 00  00 00 00 00 00 00 00 00  |XXXX............|
+00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00002000
+00000000  58 58 58 58 00 00 00 00  00 00 00 00 00 00 00 00  |XXXX............|
+00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00002000
diff --git a/tests/generic/group b/tests/generic/group
index e5db772..91c5870 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -69,6 +69,7 @@
 064 auto quick prealloc
 065 metadata auto quick
 066 metadata auto quick
+067 auto quick rw
 068 other auto freeze dangerous stress
 069 rw udf auto quick
 070 attr udf auto quick stress
-- 
2.1.1


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

* [PATCH 2/2] f2fs/001: introduce a testcaes for -ENOSPC with inline operation
  2015-03-17 17:32 [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors Jaegeuk Kim
@ 2015-03-17 17:32 ` Jaegeuk Kim
  2015-03-18  3:46 ` [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors Dave Chinner
  1 sibling, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2015-03-17 17:32 UTC (permalink / raw)
  To: Dave Chinner; +Cc: fstests, linux-f2fs-devel, Jaegeuk Kim

This patch introduces f2fs/001 to test -ENOSPC when inline operation was
activated.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 tests/f2fs/001     | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/f2fs/001.out | 21 ++++++++++++++
 tests/f2fs/group   |  6 ++++
 3 files changed, 108 insertions(+)
 create mode 100755 tests/f2fs/001
 create mode 100644 tests/f2fs/001.out
 create mode 100644 tests/f2fs/group

diff --git a/tests/f2fs/001 b/tests/f2fs/001
new file mode 100755
index 0000000..775b0f1
--- /dev/null
+++ b/tests/f2fs/001
@@ -0,0 +1,81 @@
+#! /bin/bash
+# FS QA Test No. f2fs/001
+#
+# Test -ENSPC wth inline operations.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2014 Jaegeuk Kim.  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"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+_supported_fs f2fs
+_supported_os Linux
+_require_scratch
+
+testfile=$SCRATCH_MNT/testfile
+dummyfile=$SCRATCH_MNT/dummyfile
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+
+echo "==== create small file ==="
+$XFS_IO_PROG -t -f \
+-c "pwrite -S 0x58 0 120" \
+-c "close" \
+$testfile | _filter_xfs_io
+
+echo "==== fill 100% partition ==="
+$XFS_IO_PROG -t -f \
+-c "falloc 0 8g" \
+-c "close" \
+$dummyfile | _filter_xfs_io
+
+echo "==== change i_size & write data ==="
+$XFS_IO_PROG \
+-c "truncate 4096" \
+-c "pwrite -S 0x58 8192 4096" \
+-c "close" \
+$testfile | _filter_xfs_io
+
+echo "==== check data contents ==="
+hexdump -C $testfile
+_scratch_remount
+hexdump -C $testfile
+
+rm $testfile
+rm $dummyfile
+
+status=0
+exit
diff --git a/tests/f2fs/001.out b/tests/f2fs/001.out
new file mode 100644
index 0000000..8862156
--- /dev/null
+++ b/tests/f2fs/001.out
@@ -0,0 +1,21 @@
+QA output created by 001
+==== create small file ===
+wrote 120/120 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+==== fill 100% partition ===
+fallocate: No space left on device
+==== change i_size & write data ===
+pwrite64: No space left on device
+==== check data contents ===
+00000000  58 58 58 58 58 58 58 58  58 58 58 58 58 58 58 58  |XXXXXXXXXXXXXXXX|
+*
+00000070  58 58 58 58 58 58 58 58  00 00 00 00 00 00 00 00  |XXXXXXXX........|
+00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00001000
+00000000  58 58 58 58 58 58 58 58  58 58 58 58 58 58 58 58  |XXXXXXXXXXXXXXXX|
+*
+00000070  58 58 58 58 58 58 58 58  00 00 00 00 00 00 00 00  |XXXXXXXX........|
+00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00001000
diff --git a/tests/f2fs/group b/tests/f2fs/group
new file mode 100644
index 0000000..daba9a3
--- /dev/null
+++ b/tests/f2fs/group
@@ -0,0 +1,6 @@
+# QA groups control file
+# Defines test groups and nominal group owners
+# - do not start group names with a digit
+# - comment line before each group is "new" description
+#
+001 auto quick rw
-- 
2.1.1


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

* Re: [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors
  2015-03-17 17:32 [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors Jaegeuk Kim
  2015-03-17 17:32 ` [PATCH 2/2] f2fs/001: introduce a testcaes for -ENOSPC with inline operation Jaegeuk Kim
@ 2015-03-18  3:46 ` Dave Chinner
  2015-03-18 18:01   ` Jaegeuk Kim
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2015-03-18  3:46 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: fstests, linux-f2fs-devel

On Tue, Mar 17, 2015 at 10:32:51AM -0700, Jaegeuk Kim wrote:
> This patch introduces a new testcase, generic/067, to test several truncation
> cases under the inline feature supported by filesystems.

"inline feature" means what, exactly?

> 
> +_supported_os Linux
> +_require_scratch
> +
> +testfile=$SCRATCH_MNT/testfile
> +
> +_scratch_mkfs > /dev/null 2>&1
> +_scratch_mount
> +
> +# aligned inline truncation

Aligned to what, exactly?

> +$XFS_IO_PROG -t -f \
> +-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
> +-c "fsync"	\
> +-c "truncate 0"                 `# truncate     |                        |` \
> +-c "truncate 160"               `# truncate     |                        |` \
> +-c "close"      \
> +$testfile | _filter_xfs_io

Please indent multiple line xfs_io command a little more clearly,
and align the "\" so it's clear it's amultiple line command

$XFS_IO_PROG -t -f								    \
	-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
	-c "fsync"								    \
	-c "truncate 0"                 `# truncate     |                        |` \
	-c "truncate 160"               `# truncate     |                        |` \
	-c "close"								    \
	$testfile | _filter_xfs_io

(not sure the comment on the second truncate is correct, either)

Also, why do you need the "close" command?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors
  2015-03-18  3:46 ` [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors Dave Chinner
@ 2015-03-18 18:01   ` Jaegeuk Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2015-03-18 18:01 UTC (permalink / raw)
  To: Dave Chinner; +Cc: fstests, linux-f2fs-devel

Hi Dave,

Thank you for the review.
I'll resend this series with precise description and fixes as you pointed.

Thanks,

On Wed, Mar 18, 2015 at 02:46:53PM +1100, Dave Chinner wrote:
> On Tue, Mar 17, 2015 at 10:32:51AM -0700, Jaegeuk Kim wrote:
> > This patch introduces a new testcase, generic/067, to test several truncation
> > cases under the inline feature supported by filesystems.
> 
> "inline feature" means what, exactly?
> 
> > 
> > +_supported_os Linux
> > +_require_scratch
> > +
> > +testfile=$SCRATCH_MNT/testfile
> > +
> > +_scratch_mkfs > /dev/null 2>&1
> > +_scratch_mount
> > +
> > +# aligned inline truncation
> 
> Aligned to what, exactly?
> 
> > +$XFS_IO_PROG -t -f \
> > +-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
> > +-c "fsync"	\
> > +-c "truncate 0"                 `# truncate     |                        |` \
> > +-c "truncate 160"               `# truncate     |                        |` \
> > +-c "close"      \
> > +$testfile | _filter_xfs_io
> 
> Please indent multiple line xfs_io command a little more clearly,
> and align the "\" so it's clear it's amultiple line command
> 
> $XFS_IO_PROG -t -f								    \
> 	-c "pwrite -S 0x58 0 120"       `# write        |XXXXXXXXXXXXXXXXXXXXXXXX|` \
> 	-c "fsync"								    \
> 	-c "truncate 0"                 `# truncate     |                        |` \
> 	-c "truncate 160"               `# truncate     |                        |` \
> 	-c "close"								    \
> 	$testfile | _filter_xfs_io
> 
> (not sure the comment on the second truncate is correct, either)
> 
> Also, why do you need the "close" command?
> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com

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

end of thread, other threads:[~2015-03-18 18:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 17:32 [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors Jaegeuk Kim
2015-03-17 17:32 ` [PATCH 2/2] f2fs/001: introduce a testcaes for -ENOSPC with inline operation Jaegeuk Kim
2015-03-18  3:46 ` [PATCH 1/2] generic/067: add a testcase to check some inline truncation behaviors Dave Chinner
2015-03-18 18:01   ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).