From: Chandan Rajendra <chandan@linux.vnet.ibm.com>
To: fstests@vger.kernel.org
Cc: Chandan Rajendra <chandan@linux.vnet.ibm.com>,
linux-btrfs@vger.kernel.org, fdmanana@gmail.com,
chandan@mykolab.com
Subject: [PATCH V2 5/5] Fix btrfs/096 to work on non-4k block sized filesystems
Date: Mon, 30 Nov 2015 15:47:00 +0530 [thread overview]
Message-ID: <1448878620-16382-6-git-send-email-chandan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1448878620-16382-1-git-send-email-chandan@linux.vnet.ibm.com>
This commit makes use of the new _filter_xfs_io_blocks_modified filtering
function to print information in terms of file blocks rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
tests/btrfs/096 | 45 +++++++++++++++++++++++++--------------------
tests/btrfs/096.out | 15 +++++----------
2 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/tests/btrfs/096 b/tests/btrfs/096
index f5b3a7f..896a209 100755
--- a/tests/btrfs/096
+++ b/tests/btrfs/096
@@ -51,30 +51,35 @@ rm -f $seqres.full
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
-# Create our test files. File foo has the same 2K of data at offset 4K as file
-# bar has at its offset 0.
-$XFS_IO_PROG -f -s -c "pwrite -S 0xaa 0 4K" \
- -c "pwrite -S 0xbb 4k 2K" \
- -c "pwrite -S 0xcc 8K 4K" \
- $SCRATCH_MNT/foo | _filter_xfs_io
+BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
-# File bar consists of a single inline extent (2K size).
-$XFS_IO_PROG -f -s -c "pwrite -S 0xbb 0 2K" \
- $SCRATCH_MNT/bar | _filter_xfs_io
+# Create our test files. File foo has the same 2k of data at offset $BLOCK_SIZE
+# as file bar has at its offset 0.
+$XFS_IO_PROG -f -s -c "pwrite -S 0xaa 0 $BLOCK_SIZE" \
+ -c "pwrite -S 0xbb $BLOCK_SIZE 2k" \
+ -c "pwrite -S 0xcc $(($BLOCK_SIZE * 2)) $BLOCK_SIZE" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
-# Now call the clone ioctl to clone the extent of file bar into file foo at its
-# offset 4K. This made file foo have an inline extent at offset 4K, something
-# which the btrfs code can not deal with in future IO operations because all
-# inline extents are supposed to start at an offset of 0, resulting in all sorts
-# of chaos.
-# So here we validate that the clone ioctl returns an EOPNOTSUPP, which is what
-# it returns for other cases dealing with inlined extents.
-$CLONER_PROG -s 0 -d $((4 * 1024)) -l $((2 * 1024)) \
+# File bar consists of a single inline extent (2k in size).
+$XFS_IO_PROG -f -s -c "pwrite -S 0xbb 0 2k" \
+ $SCRATCH_MNT/bar | _filter_xfs_io_blocks_modified
+
+# Now call the clone ioctl to clone the extent of file bar into file
+# foo at its $BLOCK_SIZE offset. This made file foo have an inline
+# extent at offset $BLOCK_SIZE, something which the btrfs code can not
+# deal with in future IO operations because all inline extents are
+# supposed to start at an offset of 0, resulting in all sorts of
+# chaos.
+# So here we validate that the clone ioctl returns an EOPNOTSUPP,
+# which is what it returns for other cases dealing with inlined
+# extents.
+$CLONER_PROG -s 0 -d $BLOCK_SIZE -l 2048 \
$SCRATCH_MNT/bar $SCRATCH_MNT/foo
-# Because of the inline extent at offset 4K, the following write made the kernel
-# crash with a BUG_ON().
-$XFS_IO_PROG -c "pwrite -S 0xdd 6K 2K" $SCRATCH_MNT/foo | _filter_xfs_io
+# Because of the inline extent at offset $BLOCK_SIZE, the following
+# write made the kernel crash with a BUG_ON().
+$XFS_IO_PROG -c "pwrite -S 0xdd $(($BLOCK_SIZE + 2048)) 2k" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
status=0
exit
diff --git a/tests/btrfs/096.out b/tests/btrfs/096.out
index 235198d..2a4251e 100644
--- a/tests/btrfs/096.out
+++ b/tests/btrfs/096.out
@@ -1,12 +1,7 @@
QA output created by 096
-wrote 4096/4096 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 2048/2048 bytes at offset 4096
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 8192
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 2048/2048 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Blocks modified: [0 - 0]
+Blocks modified: [1 - 1]
+Blocks modified: [2 - 2]
+Blocks modified: [0 - 0]
clone failed: Operation not supported
-wrote 2048/2048 bytes at offset 6144
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Blocks modified: [1 - 1]
--
2.1.0
next prev parent reply other threads:[~2015-11-30 10:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 10:16 [PATCH V2 0/5] Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
2015-11-30 10:16 ` [PATCH V2 1/5] Filter xfs_io and od's output in units of FS block size Chandan Rajendra
2015-12-10 17:24 ` Filipe Manana
2015-11-30 10:16 ` [PATCH V2 2/5] Fix btrfs/017 to work on non-4k block sized filesystems Chandan Rajendra
2015-12-10 17:25 ` Filipe Manana
2015-11-30 10:16 ` [PATCH V2 3/5] Fix btrfs/055 " Chandan Rajendra
2015-12-10 17:25 ` Filipe Manana
2015-11-30 10:16 ` [PATCH V2 4/5] Fix btrfs/056 " Chandan Rajendra
2015-12-10 17:26 ` Filipe Manana
2015-11-30 10:17 ` Chandan Rajendra [this message]
2015-12-10 17:25 ` [PATCH V2 5/5] Fix btrfs/096 " Filipe Manana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1448878620-16382-6-git-send-email-chandan@linux.vnet.ibm.com \
--to=chandan@linux.vnet.ibm.com \
--cc=chandan@mykolab.com \
--cc=fdmanana@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox