* [PATCH 1/8] Filter xfs_io's output in units of page size
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:26 ` Filipe Manana
2015-11-30 10:17 ` [PATCH 2/8] Fix btrfs/052 to work on non-4k block sized filesystems Chandan Rajendra
` (6 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
The helpers introduced in this commit will be used to make btrfs tests that
assume 4k as the page size to work on non-4k page-sized systems as well.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
common/filter | 8 ++++++++
common/rc | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/common/filter b/common/filter
index 05f2fab..1be377c 100644
--- a/common/filter
+++ b/common/filter
@@ -261,6 +261,14 @@ _filter_xfs_io_blocks_modified()
_filter_xfs_io_units_modified "Block" $BLOCK_SIZE
}
+_filter_xfs_io_pages_modified()
+{
+ PAGE_SIZE=$(get_page_size)
+
+ _filter_xfs_io_units_modified "Page" $PAGE_SIZE
+}
+
+
_filter_test_dir()
{
sed -e "s,$TEST_DEV,TEST_DEV,g" -e "s,$TEST_DIR,TEST_DIR,g"
diff --git a/common/rc b/common/rc
index 4c2f42c..82c1bbb 100644
--- a/common/rc
+++ b/common/rc
@@ -3151,6 +3151,12 @@ get_block_size()
echo `stat -f -c %S $1`
}
+get_page_size()
+{
+ echo $(getconf PAGE_SIZE)
+}
+
+
init_rc
################################################################################
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 1/8] Filter xfs_io's output in units of page size
2015-11-30 10:17 ` [PATCH 1/8] Filter xfs_io's output in units of page size Chandan Rajendra
@ 2015-12-10 17:26 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:26 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> The helpers introduced in this commit will be used to make btrfs tests that
> assume 4k as the page size to work on non-4k page-sized systems as well.
>
> Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> common/filter | 8 ++++++++
> common/rc | 6 ++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/common/filter b/common/filter
> index 05f2fab..1be377c 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -261,6 +261,14 @@ _filter_xfs_io_blocks_modified()
> _filter_xfs_io_units_modified "Block" $BLOCK_SIZE
> }
>
> +_filter_xfs_io_pages_modified()
> +{
> + PAGE_SIZE=$(get_page_size)
> +
> + _filter_xfs_io_units_modified "Page" $PAGE_SIZE
> +}
> +
> +
> _filter_test_dir()
> {
> sed -e "s,$TEST_DEV,TEST_DEV,g" -e "s,$TEST_DIR,TEST_DIR,g"
> diff --git a/common/rc b/common/rc
> index 4c2f42c..82c1bbb 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3151,6 +3151,12 @@ get_block_size()
> echo `stat -f -c %S $1`
> }
>
> +get_page_size()
> +{
> + echo $(getconf PAGE_SIZE)
> +}
> +
> +
> init_rc
>
> ################################################################################
> --
> 2.1.0
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 2/8] Fix btrfs/052 to work on non-4k block sized filesystems
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
2015-11-30 10:17 ` [PATCH 1/8] Filter xfs_io's output in units of page size Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:28 ` Filipe Manana
2015-11-30 10:17 ` [PATCH 3/8] Fix btrfs/094 " Chandan Rajendra
` (5 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
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/052 | 122 +++++----
tests/btrfs/052.out | 744 +++++++++++++++++++++++++++++++---------------------
2 files changed, 515 insertions(+), 351 deletions(-)
diff --git a/tests/btrfs/052 b/tests/btrfs/052
index c75193d..b760b92 100755
--- a/tests/btrfs/052
+++ b/tests/btrfs/052
@@ -59,78 +59,98 @@ test_btrfs_clone_same_file()
_scratch_mkfs >/dev/null 2>&1
_scratch_mount $MOUNT_OPTIONS
- # Create a file with 5 extents, 4 of 8Kb each and 1 of 64Kb.
- $XFS_IO_PROG -f -c "pwrite -S 0x01 -b 8192 0 8192" $SCRATCH_MNT/foo \
- | _filter_xfs_io
+ BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
+
+ EXTENT_SIZE=$((2 * $BLOCK_SIZE))
+
+ # Create a file with 5 extents, 4 extents of 2 blocks each and 1 extent
+ # of 16 blocks.
+ OFFSET=0
+ $XFS_IO_PROG -f -c "pwrite -S 0x01 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
+ | _filter_xfs_io_blocks_modified
sync
- $XFS_IO_PROG -c "pwrite -S 0x02 -b 8192 8192 8192" $SCRATCH_MNT/foo \
- | _filter_xfs_io
+
+ OFFSET=$(($OFFSET + $EXTENT_SIZE))
+ $XFS_IO_PROG -c "pwrite -S 0x02 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
+ | _filter_xfs_io_blocks_modified
sync
- $XFS_IO_PROG -c "pwrite -S 0x03 -b 8192 16384 8192" $SCRATCH_MNT/foo \
- | _filter_xfs_io
+
+ OFFSET=$(($OFFSET + $EXTENT_SIZE))
+ $XFS_IO_PROG -c "pwrite -S 0x03 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
+ | _filter_xfs_io_blocks_modified
sync
- $XFS_IO_PROG -c "pwrite -S 0x04 -b 8192 24576 8192" $SCRATCH_MNT/foo \
- | _filter_xfs_io
+
+ OFFSET=$(($OFFSET + $EXTENT_SIZE))
+ $XFS_IO_PROG -c "pwrite -S 0x04 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
+ | _filter_xfs_io_blocks_modified
sync
- $XFS_IO_PROG -c "pwrite -S 0x05 -b 65536 32768 65536" $SCRATCH_MNT/foo \
- | _filter_xfs_io
+
+ OFFSET=$(($OFFSET + $EXTENT_SIZE))
+ EXTENT_SIZE=$((16 * $BLOCK_SIZE))
+ $XFS_IO_PROG -c "pwrite -S 0x05 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
+ | _filter_xfs_io_blocks_modified
sync
- # Digest of initial content.
- md5sum $SCRATCH_MNT/foo | _filter_scratch
+ # Initial file content.
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
# Same source and target ranges - must fail.
- $CLONER_PROG -s 8192 -d 8192 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+ $CLONER_PROG -s $((2 * $BLOCK_SIZE)) -d $((2 * $BLOCK_SIZE)) \
+ -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
# Check file content didn't change.
- md5sum $SCRATCH_MNT/foo | _filter_scratch
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
# Intersection between source and target ranges - must fail too.
- $CLONER_PROG -s 4096 -d 8192 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+ # $CLONER_PROG -s 4096 -d 8192 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+ $CLONER_PROG -s $((1 * $BLOCK_SIZE)) -d $((2 * $BLOCK_SIZE)) \
+ -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
# Check file content didn't change.
- md5sum $SCRATCH_MNT/foo | _filter_scratch
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
# Clone an entire extent from a higher range to a lower range.
- $CLONER_PROG -s 24576 -d 0 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
-
- # Check entire file, the 8Kb block at offset 0 now has the same content
- # as the 8Kb block at offset 24576.
- od -t x1 $SCRATCH_MNT/foo
+ $CLONER_PROG -s $((6 * $BLOCK_SIZE)) -d 0 -l $((2 * $BLOCK_SIZE)) \
+ $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+ # Check entire file, 0th and 1st blocks now have the same content
+ # as the 6th and 7th blocks.
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
# Clone an entire extent from a lower range to a higher range.
- $CLONER_PROG -s 8192 -d 16384 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
-
- # Check entire file, the 8Kb block at offset 0 now has the same content
- # as the 8Kb block at offset 24576, and the 8Kb block at offset 16384
- # now has the same content as the 8Kb block at offset 8192.
- od -t x1 $SCRATCH_MNT/foo
-
- # Now clone 1 extent and an half into the file range starting at offset
- # 65536. So we get the second half of the extent at offset 16384 and the
- # whole extent at 24576 cloned into the middle of the 64Kb extent that
- # starts at file offset 32768. This makes the clone ioctl process more
- # extent items from the b+tree and forces a split of the large 64Kb
- # extent at the end of the file.
- $CLONER_PROG -s 20480 -d 65536 -l 12288 $SCRATCH_MNT/foo \
- $SCRATCH_MNT/foo
-
- # Check entire file. Besides the previous changes, we now should have
- # 4096 bytes with the value 0x02 at file offset 65536, and 8192 bytes
- # with value 0x04 at the file offset 69632. The ranges [32768, 65536[
- # and [77824, 98304[ should remain with all bytes having the value 0x05.
- od -t x1 $SCRATCH_MNT/foo
-
- # Now update 8Kb of data at offset 0. The extent at this position is a
- # clone of the extent at offset 24576. Check that writing to this offset
- # doesn't change data at offset 24576.
- $XFS_IO_PROG -c "pwrite -S 0xff -b 8192 0 8192" $SCRATCH_MNT/foo \
- | _filter_xfs_io
- od -t x1 $SCRATCH_MNT/foo
+ $CLONER_PROG -s $((2 * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \
+ -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+ # Check entire file, 0th and 1st blocks now have the same content
+ # as the 6th and 7th block, and 4th and 5th blocks now has the same
+ # content as the 2nd and 3rd blocks.
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
+
+ # Now clone 1 extent and an half into the file range starting
+ # at 16th block So we get the second half of the extent
+ # starting at 4th block and the whole extent starting at 6th
+ # block cloned into the middle of the 16 blocks extent that
+ # starts at 8th block. This makes the clone ioctl process more
+ # extent items from the b+tree and forces a split of the large
+ # 16-block extent at the end of the file.
+ $CLONER_PROG -s $((5 * $BLOCK_SIZE)) -d $((16 * $BLOCK_SIZE)) \
+ -l $((3 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+
+ # Check entire file. Besides the previous changes, we now
+ # should have 1 block with the value 0x02 at 16th block, and 2
+ # blocks with value 0x04 starting at the 17th block . The
+ # block ranges [8, 16[ and [19, 24[ should remain with all
+ # bytes having the value 0x05.
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
+
+ # Now update 2 blocks of data at offset 0. The extent at this
+ # position is a clone of the extent at 6th block. Check that
+ # writing to this offset doesn't change data at 6th block.
+ $XFS_IO_PROG -c "pwrite -S 0xff -b $((2 * $BLOCK_SIZE)) 0 $((2 * $BLOCK_SIZE))" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
# Check that after defragmenting the file and re-mounting, the file
# content remains exactly the same as before.
_run_btrfs_util_prog filesystem defragment $SCRATCH_MNT/foo
_scratch_remount
- od -t x1 $SCRATCH_MNT/foo
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
# Verify that there are no consistency errors.
_check_scratch_fs
diff --git a/tests/btrfs/052.out b/tests/btrfs/052.out
index 53a1868..ac5924e 100644
--- a/tests/btrfs/052.out
+++ b/tests/btrfs/052.out
@@ -1,499 +1,643 @@
QA output created by 052
Testing with a cow file (default)
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 8192
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 16384
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 24576
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 65536/65536 bytes at offset 32768
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+Blocks modified: [0 - 1]
+Blocks modified: [2 - 3]
+Blocks modified: [4 - 5]
+Blocks modified: [6 - 7]
+Blocks modified: [8 - 23]
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+Blocks modified: [0 - 1]
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
Testing with a nocow file (-O nodatacow)
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 8192
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 16384
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 24576
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 65536/65536 bytes at offset 32768
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+Blocks modified: [0 - 1]
+Blocks modified: [2 - 3]
+Blocks modified: [4 - 5]
+Blocks modified: [6 - 7]
+Blocks modified: [8 - 23]
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+Blocks modified: [0 - 1]
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
Testing with a cow file and lzo compression
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 8192
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 16384
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 24576
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 65536/65536 bytes at offset 32768
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+Blocks modified: [0 - 1]
+Blocks modified: [2 - 3]
+Blocks modified: [4 - 5]
+Blocks modified: [6 - 7]
+Blocks modified: [8 - 23]
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+30
+Blocks modified: [0 - 1]
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+30
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
+30
Testing with a cow file and zlib compression
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 8192
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 16384
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 24576
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 65536/65536 bytes at offset 32768
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+Blocks modified: [0 - 1]
+Blocks modified: [2 - 3]
+Blocks modified: [4 - 5]
+Blocks modified: [6 - 7]
+Blocks modified: [8 - 23]
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+Blocks modified: [0 - 1]
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+30
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
Testing with a nocow file and lzo compression
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 8192
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 16384
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 24576
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 65536/65536 bytes at offset 32768
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+Blocks modified: [0 - 1]
+Blocks modified: [2 - 3]
+Blocks modified: [4 - 5]
+Blocks modified: [6 - 7]
+Blocks modified: [8 - 23]
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+Blocks modified: [0 - 1]
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+30
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0300000
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
Testing with a nocow file and zlib compression
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 8192
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 16384
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 bytes at offset 24576
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 65536/65536 bytes at offset 32768
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+Blocks modified: [0 - 1]
+Blocks modified: [2 - 3]
+Blocks modified: [4 - 5]
+Blocks modified: [6 - 7]
+Blocks modified: [8 - 23]
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
clone failed: Invalid argument
-5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
+*
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+*
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+*
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+*
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+*
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
+4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+30
+0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-wrote 8192/8192 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+30
+Blocks modified: [0 - 1]
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
-0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+30
+0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
+20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
*
-0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
+21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
*
-0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
+23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
*
-0300000
+30
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 2/8] Fix btrfs/052 to work on non-4k block sized filesystems
2015-11-30 10:17 ` [PATCH 2/8] Fix btrfs/052 to work on non-4k block sized filesystems Chandan Rajendra
@ 2015-12-10 17:28 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:28 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> 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>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> tests/btrfs/052 | 122 +++++----
> tests/btrfs/052.out | 744 +++++++++++++++++++++++++++++++---------------------
> 2 files changed, 515 insertions(+), 351 deletions(-)
>
> diff --git a/tests/btrfs/052 b/tests/btrfs/052
> index c75193d..b760b92 100755
> --- a/tests/btrfs/052
> +++ b/tests/btrfs/052
> @@ -59,78 +59,98 @@ test_btrfs_clone_same_file()
> _scratch_mkfs >/dev/null 2>&1
> _scratch_mount $MOUNT_OPTIONS
>
> - # Create a file with 5 extents, 4 of 8Kb each and 1 of 64Kb.
> - $XFS_IO_PROG -f -c "pwrite -S 0x01 -b 8192 0 8192" $SCRATCH_MNT/foo \
> - | _filter_xfs_io
> + BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
> +
> + EXTENT_SIZE=$((2 * $BLOCK_SIZE))
> +
> + # Create a file with 5 extents, 4 extents of 2 blocks each and 1 extent
> + # of 16 blocks.
> + OFFSET=0
> + $XFS_IO_PROG -f -c "pwrite -S 0x01 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
> + | _filter_xfs_io_blocks_modified
> sync
> - $XFS_IO_PROG -c "pwrite -S 0x02 -b 8192 8192 8192" $SCRATCH_MNT/foo \
> - | _filter_xfs_io
> +
> + OFFSET=$(($OFFSET + $EXTENT_SIZE))
> + $XFS_IO_PROG -c "pwrite -S 0x02 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
> + | _filter_xfs_io_blocks_modified
> sync
> - $XFS_IO_PROG -c "pwrite -S 0x03 -b 8192 16384 8192" $SCRATCH_MNT/foo \
> - | _filter_xfs_io
> +
> + OFFSET=$(($OFFSET + $EXTENT_SIZE))
> + $XFS_IO_PROG -c "pwrite -S 0x03 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
> + | _filter_xfs_io_blocks_modified
> sync
> - $XFS_IO_PROG -c "pwrite -S 0x04 -b 8192 24576 8192" $SCRATCH_MNT/foo \
> - | _filter_xfs_io
> +
> + OFFSET=$(($OFFSET + $EXTENT_SIZE))
> + $XFS_IO_PROG -c "pwrite -S 0x04 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
> + | _filter_xfs_io_blocks_modified
> sync
> - $XFS_IO_PROG -c "pwrite -S 0x05 -b 65536 32768 65536" $SCRATCH_MNT/foo \
> - | _filter_xfs_io
> +
> + OFFSET=$(($OFFSET + $EXTENT_SIZE))
> + EXTENT_SIZE=$((16 * $BLOCK_SIZE))
> + $XFS_IO_PROG -c "pwrite -S 0x05 -b $EXTENT_SIZE $OFFSET $EXTENT_SIZE" $SCRATCH_MNT/foo \
> + | _filter_xfs_io_blocks_modified
> sync
>
> - # Digest of initial content.
> - md5sum $SCRATCH_MNT/foo | _filter_scratch
> + # Initial file content.
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # Same source and target ranges - must fail.
> - $CLONER_PROG -s 8192 -d 8192 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> + $CLONER_PROG -s $((2 * $BLOCK_SIZE)) -d $((2 * $BLOCK_SIZE)) \
> + -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> # Check file content didn't change.
> - md5sum $SCRATCH_MNT/foo | _filter_scratch
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # Intersection between source and target ranges - must fail too.
> - $CLONER_PROG -s 4096 -d 8192 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> + # $CLONER_PROG -s 4096 -d 8192 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> + $CLONER_PROG -s $((1 * $BLOCK_SIZE)) -d $((2 * $BLOCK_SIZE)) \
> + -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> # Check file content didn't change.
> - md5sum $SCRATCH_MNT/foo | _filter_scratch
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # Clone an entire extent from a higher range to a lower range.
> - $CLONER_PROG -s 24576 -d 0 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> -
> - # Check entire file, the 8Kb block at offset 0 now has the same content
> - # as the 8Kb block at offset 24576.
> - od -t x1 $SCRATCH_MNT/foo
> + $CLONER_PROG -s $((6 * $BLOCK_SIZE)) -d 0 -l $((2 * $BLOCK_SIZE)) \
> + $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> + # Check entire file, 0th and 1st blocks now have the same content
> + # as the 6th and 7th blocks.
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # Clone an entire extent from a lower range to a higher range.
> - $CLONER_PROG -s 8192 -d 16384 -l 8192 $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> -
> - # Check entire file, the 8Kb block at offset 0 now has the same content
> - # as the 8Kb block at offset 24576, and the 8Kb block at offset 16384
> - # now has the same content as the 8Kb block at offset 8192.
> - od -t x1 $SCRATCH_MNT/foo
> -
> - # Now clone 1 extent and an half into the file range starting at offset
> - # 65536. So we get the second half of the extent at offset 16384 and the
> - # whole extent at 24576 cloned into the middle of the 64Kb extent that
> - # starts at file offset 32768. This makes the clone ioctl process more
> - # extent items from the b+tree and forces a split of the large 64Kb
> - # extent at the end of the file.
> - $CLONER_PROG -s 20480 -d 65536 -l 12288 $SCRATCH_MNT/foo \
> - $SCRATCH_MNT/foo
> -
> - # Check entire file. Besides the previous changes, we now should have
> - # 4096 bytes with the value 0x02 at file offset 65536, and 8192 bytes
> - # with value 0x04 at the file offset 69632. The ranges [32768, 65536[
> - # and [77824, 98304[ should remain with all bytes having the value 0x05.
> - od -t x1 $SCRATCH_MNT/foo
> -
> - # Now update 8Kb of data at offset 0. The extent at this position is a
> - # clone of the extent at offset 24576. Check that writing to this offset
> - # doesn't change data at offset 24576.
> - $XFS_IO_PROG -c "pwrite -S 0xff -b 8192 0 8192" $SCRATCH_MNT/foo \
> - | _filter_xfs_io
> - od -t x1 $SCRATCH_MNT/foo
> + $CLONER_PROG -s $((2 * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \
> + -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> + # Check entire file, 0th and 1st blocks now have the same content
> + # as the 6th and 7th block, and 4th and 5th blocks now has the same
> + # content as the 2nd and 3rd blocks.
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
> +
> + # Now clone 1 extent and an half into the file range starting
> + # at 16th block So we get the second half of the extent
> + # starting at 4th block and the whole extent starting at 6th
> + # block cloned into the middle of the 16 blocks extent that
> + # starts at 8th block. This makes the clone ioctl process more
> + # extent items from the b+tree and forces a split of the large
> + # 16-block extent at the end of the file.
> + $CLONER_PROG -s $((5 * $BLOCK_SIZE)) -d $((16 * $BLOCK_SIZE)) \
> + -l $((3 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> +
> + # Check entire file. Besides the previous changes, we now
> + # should have 1 block with the value 0x02 at 16th block, and 2
> + # blocks with value 0x04 starting at the 17th block . The
> + # block ranges [8, 16[ and [19, 24[ should remain with all
> + # bytes having the value 0x05.
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
> +
> + # Now update 2 blocks of data at offset 0. The extent at this
> + # position is a clone of the extent at 6th block. Check that
> + # writing to this offset doesn't change data at 6th block.
> + $XFS_IO_PROG -c "pwrite -S 0xff -b $((2 * $BLOCK_SIZE)) 0 $((2 * $BLOCK_SIZE))" \
> + $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # Check that after defragmenting the file and re-mounting, the file
> # content remains exactly the same as before.
> _run_btrfs_util_prog filesystem defragment $SCRATCH_MNT/foo
> _scratch_remount
> - od -t x1 $SCRATCH_MNT/foo
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # Verify that there are no consistency errors.
> _check_scratch_fs
> diff --git a/tests/btrfs/052.out b/tests/btrfs/052.out
> index 53a1868..ac5924e 100644
> --- a/tests/btrfs/052.out
> +++ b/tests/btrfs/052.out
> @@ -1,499 +1,643 @@
> QA output created by 052
> Testing with a cow file (default)
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 8192
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 16384
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 24576
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 32768
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +Blocks modified: [0 - 1]
> +Blocks modified: [2 - 3]
> +Blocks modified: [4 - 5]
> +Blocks modified: [6 - 7]
> +Blocks modified: [8 - 23]
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +Blocks modified: [0 - 1]
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> Testing with a nocow file (-O nodatacow)
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 8192
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 16384
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 24576
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 32768
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +Blocks modified: [0 - 1]
> +Blocks modified: [2 - 3]
> +Blocks modified: [4 - 5]
> +Blocks modified: [6 - 7]
> +Blocks modified: [8 - 23]
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +Blocks modified: [0 - 1]
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> Testing with a cow file and lzo compression
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 8192
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 16384
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 24576
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 32768
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +Blocks modified: [0 - 1]
> +Blocks modified: [2 - 3]
> +Blocks modified: [4 - 5]
> +Blocks modified: [6 - 7]
> +Blocks modified: [8 - 23]
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +30
> +Blocks modified: [0 - 1]
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +30
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> +30
> Testing with a cow file and zlib compression
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 8192
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 16384
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 24576
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 32768
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +Blocks modified: [0 - 1]
> +Blocks modified: [2 - 3]
> +Blocks modified: [4 - 5]
> +Blocks modified: [6 - 7]
> +Blocks modified: [8 - 23]
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +Blocks modified: [0 - 1]
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +30
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> Testing with a nocow file and lzo compression
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 8192
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 16384
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 24576
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 32768
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +Blocks modified: [0 - 1]
> +Blocks modified: [2 - 3]
> +Blocks modified: [4 - 5]
> +Blocks modified: [6 - 7]
> +Blocks modified: [8 - 23]
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +Blocks modified: [0 - 1]
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +30
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0300000
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> Testing with a nocow file and zlib compression
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 8192
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 16384
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 bytes at offset 24576
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 65536/65536 bytes at offset 32768
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +Blocks modified: [0 - 1]
> +Blocks modified: [2 - 3]
> +Blocks modified: [4 - 5]
> +Blocks modified: [6 - 7]
> +Blocks modified: [8 - 23]
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> clone failed: Invalid argument
> -5af7a1d6d3757be1e3e911ba5fdf4cbe SCRATCH_MNT/foo
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +0 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
> +*
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +*
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +*
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +*
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +*
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0040000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> +4 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +30
> +0 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -wrote 8192/8192 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +30
> +Blocks modified: [0 - 1]
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> -0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> +30
> +0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> *
> -0020000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +2 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0060000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +6 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0100000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +10 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0200000 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> +20 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
> *
> -0210000 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> +21 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04
> *
> -0230000 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> +23 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
> *
> -0300000
> +30
> --
> 2.1.0
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/8] Fix btrfs/094 to work on non-4k block sized filesystems
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
2015-11-30 10:17 ` [PATCH 1/8] Filter xfs_io's output in units of page size Chandan Rajendra
2015-11-30 10:17 ` [PATCH 2/8] Fix btrfs/052 to work on non-4k block sized filesystems Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:26 ` Filipe Manana
2015-11-30 10:17 ` [PATCH 4/8] Fix btrfs/095 " Chandan Rajendra
` (4 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
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/094 | 75 ++++++++++++++++++++++++++++++-----------------------
tests/btrfs/094.out | 71 ++++++++++++++++++++++++++++++++++++++++----------
2 files changed, 100 insertions(+), 46 deletions(-)
diff --git a/tests/btrfs/094 b/tests/btrfs/094
index 6f6cdeb..45f108d 100755
--- a/tests/btrfs/094
+++ b/tests/btrfs/094
@@ -67,36 +67,41 @@ mkdir $send_files_dir
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount "-o compress"
-# Create the file with a single extent of 128K. This creates a metadata file
-# extent item with a data start offset of 0 and a logical length of 128K.
-$XFS_IO_PROG -f -c "pwrite -S 0xaa 64K 128K" -c "fsync" \
- $SCRATCH_MNT/foo | _filter_xfs_io
-
-# Now rewrite the range 64K to 112K of our file. This will make the inode's
-# metadata continue to point to the 128K extent we created before, but now
-# with an extent item that points to the extent with a data start offset of
-# 112K and a logical length of 16K.
-# That metadata file extent item is associated with the logical file offset
-# at 176K and covers the logical file range 176K to 192K.
-$XFS_IO_PROG -c "pwrite -S 0xbb 64K 112K" -c "fsync" \
- $SCRATCH_MNT/foo | _filter_xfs_io
-
-# Now rewrite the range 180K to 12K. This will make the inode's metadata
-# continue to point the the 128K extent we created earlier, with a single
-# extent item that points to it with a start offset of 112K and a logical
-# length of 4K.
-# That metadata file extent item is associated with the logical file offset
-# at 176K and covers the logical file range 176K to 180K.
-$XFS_IO_PROG -c "pwrite -S 0xcc 180K 12K" -c "fsync" \
- $SCRATCH_MNT/foo | _filter_xfs_io
+BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
+
+# Create the file with a single extent of 32 blocks. This creates a metadata
+# file extent item with a data start offset of 0 and a logical length of
+# 32 blocks.
+$XFS_IO_PROG -f -c "pwrite -S 0xaa $((16 * $BLOCK_SIZE)) $((32 * $BLOCK_SIZE))" \
+ -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
+
+# Now rewrite the block range [16, 28[ of our file. This will make
+# the inode's metadata continue to point to the single 32 block extent
+# we created before, but now with an extent item that points to the
+# extent with a data start offset referring to the 28th block and a
+# logical length of 4 blocks.
+# That metadata file extent item is associated with the block range
+# [44, 48[.
+$XFS_IO_PROG -c "pwrite -S 0xbb $((16 * $BLOCK_SIZE)) $((28 * $BLOCK_SIZE))" \
+ -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
+
+
+# Now rewrite the block range [45, 48[. This will make the inode's
+# metadata continue to point the 32 block extent we created earlier,
+# with a single extent item that points to it with a start offset
+# referring to the 28th block and a logical length of 1 block.
+# That metadata file extent item is associated with the block range
+# [44, 45[.
+$XFS_IO_PROG -c "pwrite -S 0xcc $((45 * $BLOCK_SIZE)) $((3 * $BLOCK_SIZE))" \
+ -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
-# Now clone that same region of the 128K extent into a new file, so that it
+# Now clone that same region of the 32 block extent into a new file, so that it
# gets referenced twice and the incremental send operation below decides to
# issue a clone operation instead of copying the data.
touch $SCRATCH_MNT/bar
-$CLONER_PROG -s $((176 * 1024)) -d $((176 * 1024)) -l $((4 * 1024)) \
+$CLONER_PROG -s $((44 * $BLOCK_SIZE)) -d $((44 * $BLOCK_SIZE)) -l $BLOCK_SIZE \
$SCRATCH_MNT/foo $SCRATCH_MNT/bar
_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
@@ -105,10 +110,13 @@ _run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
_run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
-f $send_files_dir/2.snap
-echo "File digests in the original filesystem:"
-md5sum $SCRATCH_MNT/mysnap1/foo | _filter_scratch
-md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
-md5sum $SCRATCH_MNT/mysnap2/bar | _filter_scratch
+echo "File contents in the original filesystem:"
+echo "mysnap1/foo"
+od -t x1 $SCRATCH_MNT/mysnap1/foo | _filter_od
+echo "mysnap2/foo"
+od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
+echo "mysnap2/bar"
+od -t x1 $SCRATCH_MNT/mysnap2/bar | _filter_od
# Now recreate the filesystem by receiving both send streams and verify we get
# the same file contents that the original filesystem had.
@@ -119,10 +127,13 @@ _scratch_mount
_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
-echo "File digests in the new filesystem:"
-md5sum $SCRATCH_MNT/mysnap1/foo | _filter_scratch
-md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
-md5sum $SCRATCH_MNT/mysnap2/bar | _filter_scratch
+echo "File contents in the new filesystem:"
+echo "mysnap1/foo"
+od -t x1 $SCRATCH_MNT/mysnap1/foo | _filter_od
+echo "mysnap2/foo"
+od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
+echo "mysnap2/bar"
+od -t x1 $SCRATCH_MNT/mysnap2/bar | _filter_od
status=0
exit
diff --git a/tests/btrfs/094.out b/tests/btrfs/094.out
index c3ac1bf..1c00cc5 100644
--- a/tests/btrfs/094.out
+++ b/tests/btrfs/094.out
@@ -1,15 +1,58 @@
QA output created by 094
-wrote 131072/131072 bytes at offset 65536
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 114688/114688 bytes at offset 65536
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 12288/12288 bytes at offset 184320
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digests in the original filesystem:
-f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap1/foo
-f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap2/foo
-7fccf6175f5c68504b408719a21db99f SCRATCH_MNT/mysnap2/bar
-File digests in the new filesystem:
-f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap1/foo
-f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap2/foo
-7fccf6175f5c68504b408719a21db99f SCRATCH_MNT/mysnap2/bar
+Blocks modified: [16 - 47]
+Blocks modified: [16 - 43]
+Blocks modified: [45 - 47]
+File contents in the original filesystem:
+mysnap1/foo
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+60
+mysnap2/foo
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+60
+mysnap2/bar
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+55
+File contents in the new filesystem:
+mysnap1/foo
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+60
+mysnap2/foo
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+60
+mysnap2/bar
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+55
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 3/8] Fix btrfs/094 to work on non-4k block sized filesystems
2015-11-30 10:17 ` [PATCH 3/8] Fix btrfs/094 " Chandan Rajendra
@ 2015-12-10 17:26 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:26 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> 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>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> tests/btrfs/094 | 75 ++++++++++++++++++++++++++++++-----------------------
> tests/btrfs/094.out | 71 ++++++++++++++++++++++++++++++++++++++++----------
> 2 files changed, 100 insertions(+), 46 deletions(-)
>
> diff --git a/tests/btrfs/094 b/tests/btrfs/094
> index 6f6cdeb..45f108d 100755
> --- a/tests/btrfs/094
> +++ b/tests/btrfs/094
> @@ -67,36 +67,41 @@ mkdir $send_files_dir
> _scratch_mkfs >>$seqres.full 2>&1
> _scratch_mount "-o compress"
>
> -# Create the file with a single extent of 128K. This creates a metadata file
> -# extent item with a data start offset of 0 and a logical length of 128K.
> -$XFS_IO_PROG -f -c "pwrite -S 0xaa 64K 128K" -c "fsync" \
> - $SCRATCH_MNT/foo | _filter_xfs_io
> -
> -# Now rewrite the range 64K to 112K of our file. This will make the inode's
> -# metadata continue to point to the 128K extent we created before, but now
> -# with an extent item that points to the extent with a data start offset of
> -# 112K and a logical length of 16K.
> -# That metadata file extent item is associated with the logical file offset
> -# at 176K and covers the logical file range 176K to 192K.
> -$XFS_IO_PROG -c "pwrite -S 0xbb 64K 112K" -c "fsync" \
> - $SCRATCH_MNT/foo | _filter_xfs_io
> -
> -# Now rewrite the range 180K to 12K. This will make the inode's metadata
> -# continue to point the the 128K extent we created earlier, with a single
> -# extent item that points to it with a start offset of 112K and a logical
> -# length of 4K.
> -# That metadata file extent item is associated with the logical file offset
> -# at 176K and covers the logical file range 176K to 180K.
> -$XFS_IO_PROG -c "pwrite -S 0xcc 180K 12K" -c "fsync" \
> - $SCRATCH_MNT/foo | _filter_xfs_io
> +BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
> +
> +# Create the file with a single extent of 32 blocks. This creates a metadata
> +# file extent item with a data start offset of 0 and a logical length of
> +# 32 blocks.
> +$XFS_IO_PROG -f -c "pwrite -S 0xaa $((16 * $BLOCK_SIZE)) $((32 * $BLOCK_SIZE))" \
> + -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
> +
> +# Now rewrite the block range [16, 28[ of our file. This will make
> +# the inode's metadata continue to point to the single 32 block extent
> +# we created before, but now with an extent item that points to the
> +# extent with a data start offset referring to the 28th block and a
> +# logical length of 4 blocks.
> +# That metadata file extent item is associated with the block range
> +# [44, 48[.
> +$XFS_IO_PROG -c "pwrite -S 0xbb $((16 * $BLOCK_SIZE)) $((28 * $BLOCK_SIZE))" \
> + -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
> +
> +
> +# Now rewrite the block range [45, 48[. This will make the inode's
> +# metadata continue to point the 32 block extent we created earlier,
> +# with a single extent item that points to it with a start offset
> +# referring to the 28th block and a logical length of 1 block.
> +# That metadata file extent item is associated with the block range
> +# [44, 45[.
> +$XFS_IO_PROG -c "pwrite -S 0xcc $((45 * $BLOCK_SIZE)) $((3 * $BLOCK_SIZE))" \
> + -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
>
> _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
>
> -# Now clone that same region of the 128K extent into a new file, so that it
> +# Now clone that same region of the 32 block extent into a new file, so that it
> # gets referenced twice and the incremental send operation below decides to
> # issue a clone operation instead of copying the data.
> touch $SCRATCH_MNT/bar
> -$CLONER_PROG -s $((176 * 1024)) -d $((176 * 1024)) -l $((4 * 1024)) \
> +$CLONER_PROG -s $((44 * $BLOCK_SIZE)) -d $((44 * $BLOCK_SIZE)) -l $BLOCK_SIZE \
> $SCRATCH_MNT/foo $SCRATCH_MNT/bar
>
> _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
> @@ -105,10 +110,13 @@ _run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
> _run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
> -f $send_files_dir/2.snap
>
> -echo "File digests in the original filesystem:"
> -md5sum $SCRATCH_MNT/mysnap1/foo | _filter_scratch
> -md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
> -md5sum $SCRATCH_MNT/mysnap2/bar | _filter_scratch
> +echo "File contents in the original filesystem:"
> +echo "mysnap1/foo"
> +od -t x1 $SCRATCH_MNT/mysnap1/foo | _filter_od
> +echo "mysnap2/foo"
> +od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
> +echo "mysnap2/bar"
> +od -t x1 $SCRATCH_MNT/mysnap2/bar | _filter_od
>
> # Now recreate the filesystem by receiving both send streams and verify we get
> # the same file contents that the original filesystem had.
> @@ -119,10 +127,13 @@ _scratch_mount
> _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
> _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
>
> -echo "File digests in the new filesystem:"
> -md5sum $SCRATCH_MNT/mysnap1/foo | _filter_scratch
> -md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
> -md5sum $SCRATCH_MNT/mysnap2/bar | _filter_scratch
> +echo "File contents in the new filesystem:"
> +echo "mysnap1/foo"
> +od -t x1 $SCRATCH_MNT/mysnap1/foo | _filter_od
> +echo "mysnap2/foo"
> +od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
> +echo "mysnap2/bar"
> +od -t x1 $SCRATCH_MNT/mysnap2/bar | _filter_od
>
> status=0
> exit
> diff --git a/tests/btrfs/094.out b/tests/btrfs/094.out
> index c3ac1bf..1c00cc5 100644
> --- a/tests/btrfs/094.out
> +++ b/tests/btrfs/094.out
> @@ -1,15 +1,58 @@
> QA output created by 094
> -wrote 131072/131072 bytes at offset 65536
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 114688/114688 bytes at offset 65536
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 12288/12288 bytes at offset 184320
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digests in the original filesystem:
> -f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap1/foo
> -f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap2/foo
> -7fccf6175f5c68504b408719a21db99f SCRATCH_MNT/mysnap2/bar
> -File digests in the new filesystem:
> -f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap1/foo
> -f98243c603750f7daf225b1745b31516 SCRATCH_MNT/mysnap2/foo
> -7fccf6175f5c68504b408719a21db99f SCRATCH_MNT/mysnap2/bar
> +Blocks modified: [16 - 47]
> +Blocks modified: [16 - 43]
> +Blocks modified: [45 - 47]
> +File contents in the original filesystem:
> +mysnap1/foo
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +60
> +mysnap2/foo
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +60
> +mysnap2/bar
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +55
> +File contents in the new filesystem:
> +mysnap1/foo
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +60
> +mysnap2/foo
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +20 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +55 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +60
> +mysnap2/bar
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +54 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +55
> --
> 2.1.0
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 4/8] Fix btrfs/095 to work on non-4k block sized filesystems
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
` (2 preceding siblings ...)
2015-11-30 10:17 ` [PATCH 3/8] Fix btrfs/094 " Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:27 ` Filipe Manana
2015-11-30 10:17 ` [PATCH 5/8] Fix btrfs/097 " Chandan Rajendra
` (3 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
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/095 | 110 +++++++++++++++++++++++++++++-----------------------
tests/btrfs/095.out | 42 ++++++++++++++++----
2 files changed, 96 insertions(+), 56 deletions(-)
diff --git a/tests/btrfs/095 b/tests/btrfs/095
index 1b4ba90..dec530c 100755
--- a/tests/btrfs/095
+++ b/tests/btrfs/095
@@ -63,84 +63,98 @@ _scratch_mkfs >>$seqres.full 2>&1
_init_flakey
_mount_flakey
-# Create prealloc extent covering range [160K, 620K[
-$XFS_IO_PROG -f -c "falloc 160K 460K" $SCRATCH_MNT/foo
+BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
-# Now write to the last 80K of the prealloc extent plus 40K to the unallocated
-# space that immediately follows it. This creates a new extent of 40K that spans
-# the range [620K, 660K[.
-$XFS_IO_PROG -c "pwrite -S 0xaa 540K 120K" $SCRATCH_MNT/foo | _filter_xfs_io
+# Create prealloc extent covering file block range [40, 155[
+$XFS_IO_PROG -f -c "falloc $((40 * $BLOCK_SIZE)) $((115 * $BLOCK_SIZE))" \
+ $SCRATCH_MNT/foo
+
+# Now write to the last 20 blocks of the prealloc extent plus 10 blocks to the
+# unallocated space that immediately follows it. This creates a new extent of 10
+# blocks that spans the block range [155, 165[.
+$XFS_IO_PROG -c "pwrite -S 0xaa $((135 * $BLOCK_SIZE)) $((30 * $BLOCK_SIZE))" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
# At this point, there are now 2 back references to the prealloc extent in our
-# extent tree. Both are for our file offset 160K and one relates to a file
-# extent item with a data offset of 0 and a length of 380K, while the other
-# relates to a file extent item with a data offset of 380K and a length of 80K.
+# extent tree. Both are for our file offset mapped by the 40th block of the file
+# and one relates to a file extent item with a data offset of 0 and a length of
+# 95 blocks, while the other relates to a file extent item with a data offset of
+# 95 blocks and a length of 20 blocks.
# Make sure everything done so far is durably persisted (all back references are
# in the extent tree, etc).
sync
-# Now clone all extents of our file that cover the offset 160K up to its eof
-# (660K at this point) into itself at offset 2M. This leaves a hole in the file
-# covering the range [660K, 2M[. The prealloc extent will now be referenced by
-# the file twice, once for offset 160K and once for offset 2M. The 40K extent
-# that follows the prealloc extent will also be referenced twice by our file,
-# once for offset 620K and once for offset 2M + 460K.
-$CLONER_PROG -s $((160 * 1024)) -d $((2 * 1024 * 1024)) -l 0 $SCRATCH_MNT/foo \
- $SCRATCH_MNT/foo
-
-# Now create one new extent in our file with a size of 100Kb. It will span the
-# range [3M, 3M + 100K[. It also will cause creation of a hole spanning the
-# range [2M + 460K, 3M[. Our new file size is 3M + 100K.
-$XFS_IO_PROG -c "pwrite -S 0xbb 3M 100K" $SCRATCH_MNT/foo | _filter_xfs_io
+# Now clone all extents of our file that cover the file range spanned by 40th
+# block up to its eof (165th block at this point) into itself at 512th
+# block. This leaves a hole in the file covering the block range [165, 512[. The
+# prealloc extent will now be referenced by the file twice, once for offset
+# mapped by the 40th block and once for offset mapped by 512th block. The 10
+# blocks extent that follows the prealloc extent will also be referenced twice
+# by our file, once for offset mapped by the 155th block and once for offset
+# (512 block + 115 blocks)
+$CLONER_PROG -s $((40 * $BLOCK_SIZE)) -d $((512 * $BLOCK_SIZE)) -l 0 \
+ $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+
+# Now create one new extent in our file with a size of 25 blocks. It will span
+# the block range [768, 768 + 25[. It also will cause creation of a hole
+# spanning the block range [512 + 115, 768[. Our new file size is the file
+# offset mapped by (768 + 25)th block.
+$XFS_IO_PROG -c "pwrite -S 0xbb $((768 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
# At this point, there are now (in memory) 4 back references to the prealloc
# extent.
#
-# Two of them are for file offset 160K, related to file extent items
-# matching the file offsets 160K and 540K respectively, with data offsets of
-# 0 and 380K respectively, and with lengths of 380K and 80K respectively.
+# Two of them are for file offset mapped by the 40th block, related to file
+# extent items matching the file offsets mapped by 40th and 135th block
+# respectively, with data offsets of 0 and 95 blocks respectively, and with
+# lengths of 95 and 20 blocks respectively.
#
-# The other two references are for file offset 2M, related to file extent items
-# matching the file offsets 2M and 2M + 380K respectively, with data offsets of
-# 0 and 380K respectively, and with lengths of 380K and 80K respectively.
+# The other two references are for file offset mapped by 512th block, related to
+# file extent items matching the file offsets mapped by 512th and (512 + 95)th
+# block respectively, with data offsets mapped by 0th and 95th block
+# respectively, and with lengths of 95 and 20 blocks respectively.
#
-# The 40K extent has 2 back references, one for file offset 620K and the other
-# for file offset 2M + 460K.
+# The 10 block extent has 2 back references, one for file offset mapped by 155th
+# block and the other for file offset mapped by (512 + 115)th block.
#
-# The 100K extent has a single back reference and it relates to file offset 3M.
+# The 25 blocks extent has a single back reference and it relates to file offset
+# mapped by 768th block.
+
-# Now clone our 100K extent into offset 600K. That offset covers the last 20K
-# of the prealloc extent, the whole 40K extent and 40K of the hole starting at
-# offset 660K.
-$CLONER_PROG -s $((3 * 1024 * 1024)) -d $((600 * 1024)) -l $((100 * 1024)) \
+# Now clone our 25 block extent into offset mapped by 150th block. That offset
+# covers the last 5 blocks of the prealloc extent, the whole 10 block extent and
+# 10 blocks of the hole starting at offset mapped by 165th block.
+$CLONER_PROG -s $((768 * $BLOCK_SIZE)) -d $((150 * $BLOCK_SIZE)) -l $((25 * $BLOCK_SIZE)) \
$SCRATCH_MNT/foo $SCRATCH_MNT/foo
-# At this point there's only one reference to the 40K extent, at file offset
-# 2M + 460K, we have 4 references for the prealloc extent (2 for file offset
-# 160K and 2 for file offset 2M) and 2 references for the 100K extent (1 for
-# file offset 3M and a new one for file offset 600K).
+# At this point there's only one reference to the 10 block extent, at file
+# offset mapped by (512 + 115) block, we have 4 references for the prealloc
+# extent (2 for file offset mapped by 40th block and 2 for file offset mapped by
+# 512th block) and 2 references for the 25 block extent (1 for file offset
+# mapped by 768th block and a new one for file offset mapped by 150th block).
# Now fsync our file to make all its new data and metadata updates are durably
# persisted and present if a power failure/crash happens after a successful
# fsync and before the next transaction commit.
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
-echo "File digest before power failure:"
-md5sum $SCRATCH_MNT/foo | _filter_scratch
+echo "File contents before power failure:"
+od -t x1 $SCRATCH_MNT/foo | _filter_od
# During log replay, the btrfs delayed references implementation used to run the
# deletion of back references before the addition of new back references, which
# made the addition fail as it didn't find the key in the extent tree that it
-# was looking for. The failure triggered by this test was related to the 40K
-# extent, which got 1 reference dropped and 1 reference added during the fsync
-# log replay - when running the delayed references at transaction commit time,
-# btrfs was applying the deletion before the insertion, resulting in a failure
-# of the insertion that ended up turning the fs into read-only mode.
+# was looking for. The failure triggered by this test was related to the 10
+# block extent, which got 1 reference dropped and 1 reference added during the
+# fsync log replay - when running the delayed references at transaction commit
+# time, btrfs was applying the deletion before the insertion, resulting in a
+# failure of the insertion that ended up turning the fs into read-only mode.
_flakey_drop_and_remount
-echo "File digest after log replay:"
-md5sum $SCRATCH_MNT/foo | _filter_scratch
+echo "File contents after log replay:"
+od -t x1 $SCRATCH_MNT/foo | _filter_od
_unmount_flakey
diff --git a/tests/btrfs/095.out b/tests/btrfs/095.out
index e93435c..e73b24d 100644
--- a/tests/btrfs/095.out
+++ b/tests/btrfs/095.out
@@ -1,9 +1,35 @@
QA output created by 095
-wrote 122880/122880 bytes at offset 552960
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 102400/102400 bytes at offset 3145728
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digest before power failure:
-beaf47c36659ac29bb9363fb8ffa10a1 SCRATCH_MNT/foo
-File digest after log replay:
-beaf47c36659ac29bb9363fb8ffa10a1 SCRATCH_MNT/foo
+Blocks modified: [135 - 164]
+Blocks modified: [768 - 792]
+File contents before power failure:
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+207 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+226 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+257 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+1137 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+1175 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+1400 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+1431
+File contents after log replay:
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+207 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+226 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+257 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+1137 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+1175 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+1400 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+1431
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 4/8] Fix btrfs/095 to work on non-4k block sized filesystems
2015-11-30 10:17 ` [PATCH 4/8] Fix btrfs/095 " Chandan Rajendra
@ 2015-12-10 17:27 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:27 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> 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>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> tests/btrfs/095 | 110 +++++++++++++++++++++++++++++-----------------------
> tests/btrfs/095.out | 42 ++++++++++++++++----
> 2 files changed, 96 insertions(+), 56 deletions(-)
>
> diff --git a/tests/btrfs/095 b/tests/btrfs/095
> index 1b4ba90..dec530c 100755
> --- a/tests/btrfs/095
> +++ b/tests/btrfs/095
> @@ -63,84 +63,98 @@ _scratch_mkfs >>$seqres.full 2>&1
> _init_flakey
> _mount_flakey
>
> -# Create prealloc extent covering range [160K, 620K[
> -$XFS_IO_PROG -f -c "falloc 160K 460K" $SCRATCH_MNT/foo
> +BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
>
> -# Now write to the last 80K of the prealloc extent plus 40K to the unallocated
> -# space that immediately follows it. This creates a new extent of 40K that spans
> -# the range [620K, 660K[.
> -$XFS_IO_PROG -c "pwrite -S 0xaa 540K 120K" $SCRATCH_MNT/foo | _filter_xfs_io
> +# Create prealloc extent covering file block range [40, 155[
> +$XFS_IO_PROG -f -c "falloc $((40 * $BLOCK_SIZE)) $((115 * $BLOCK_SIZE))" \
> + $SCRATCH_MNT/foo
> +
> +# Now write to the last 20 blocks of the prealloc extent plus 10 blocks to the
> +# unallocated space that immediately follows it. This creates a new extent of 10
> +# blocks that spans the block range [155, 165[.
> +$XFS_IO_PROG -c "pwrite -S 0xaa $((135 * $BLOCK_SIZE)) $((30 * $BLOCK_SIZE))" \
> + $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
>
> # At this point, there are now 2 back references to the prealloc extent in our
> -# extent tree. Both are for our file offset 160K and one relates to a file
> -# extent item with a data offset of 0 and a length of 380K, while the other
> -# relates to a file extent item with a data offset of 380K and a length of 80K.
> +# extent tree. Both are for our file offset mapped by the 40th block of the file
> +# and one relates to a file extent item with a data offset of 0 and a length of
> +# 95 blocks, while the other relates to a file extent item with a data offset of
> +# 95 blocks and a length of 20 blocks.
>
> # Make sure everything done so far is durably persisted (all back references are
> # in the extent tree, etc).
> sync
>
> -# Now clone all extents of our file that cover the offset 160K up to its eof
> -# (660K at this point) into itself at offset 2M. This leaves a hole in the file
> -# covering the range [660K, 2M[. The prealloc extent will now be referenced by
> -# the file twice, once for offset 160K and once for offset 2M. The 40K extent
> -# that follows the prealloc extent will also be referenced twice by our file,
> -# once for offset 620K and once for offset 2M + 460K.
> -$CLONER_PROG -s $((160 * 1024)) -d $((2 * 1024 * 1024)) -l 0 $SCRATCH_MNT/foo \
> - $SCRATCH_MNT/foo
> -
> -# Now create one new extent in our file with a size of 100Kb. It will span the
> -# range [3M, 3M + 100K[. It also will cause creation of a hole spanning the
> -# range [2M + 460K, 3M[. Our new file size is 3M + 100K.
> -$XFS_IO_PROG -c "pwrite -S 0xbb 3M 100K" $SCRATCH_MNT/foo | _filter_xfs_io
> +# Now clone all extents of our file that cover the file range spanned by 40th
> +# block up to its eof (165th block at this point) into itself at 512th
> +# block. This leaves a hole in the file covering the block range [165, 512[. The
> +# prealloc extent will now be referenced by the file twice, once for offset
> +# mapped by the 40th block and once for offset mapped by 512th block. The 10
> +# blocks extent that follows the prealloc extent will also be referenced twice
> +# by our file, once for offset mapped by the 155th block and once for offset
> +# (512 block + 115 blocks)
> +$CLONER_PROG -s $((40 * $BLOCK_SIZE)) -d $((512 * $BLOCK_SIZE)) -l 0 \
> + $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> +
> +# Now create one new extent in our file with a size of 25 blocks. It will span
> +# the block range [768, 768 + 25[. It also will cause creation of a hole
> +# spanning the block range [512 + 115, 768[. Our new file size is the file
> +# offset mapped by (768 + 25)th block.
> +$XFS_IO_PROG -c "pwrite -S 0xbb $((768 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))" \
> + $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
>
> # At this point, there are now (in memory) 4 back references to the prealloc
> # extent.
> #
> -# Two of them are for file offset 160K, related to file extent items
> -# matching the file offsets 160K and 540K respectively, with data offsets of
> -# 0 and 380K respectively, and with lengths of 380K and 80K respectively.
> +# Two of them are for file offset mapped by the 40th block, related to file
> +# extent items matching the file offsets mapped by 40th and 135th block
> +# respectively, with data offsets of 0 and 95 blocks respectively, and with
> +# lengths of 95 and 20 blocks respectively.
> #
> -# The other two references are for file offset 2M, related to file extent items
> -# matching the file offsets 2M and 2M + 380K respectively, with data offsets of
> -# 0 and 380K respectively, and with lengths of 380K and 80K respectively.
> +# The other two references are for file offset mapped by 512th block, related to
> +# file extent items matching the file offsets mapped by 512th and (512 + 95)th
> +# block respectively, with data offsets mapped by 0th and 95th block
> +# respectively, and with lengths of 95 and 20 blocks respectively.
> #
> -# The 40K extent has 2 back references, one for file offset 620K and the other
> -# for file offset 2M + 460K.
> +# The 10 block extent has 2 back references, one for file offset mapped by 155th
> +# block and the other for file offset mapped by (512 + 115)th block.
> #
> -# The 100K extent has a single back reference and it relates to file offset 3M.
> +# The 25 blocks extent has a single back reference and it relates to file offset
> +# mapped by 768th block.
> +
>
> -# Now clone our 100K extent into offset 600K. That offset covers the last 20K
> -# of the prealloc extent, the whole 40K extent and 40K of the hole starting at
> -# offset 660K.
> -$CLONER_PROG -s $((3 * 1024 * 1024)) -d $((600 * 1024)) -l $((100 * 1024)) \
> +# Now clone our 25 block extent into offset mapped by 150th block. That offset
> +# covers the last 5 blocks of the prealloc extent, the whole 10 block extent and
> +# 10 blocks of the hole starting at offset mapped by 165th block.
> +$CLONER_PROG -s $((768 * $BLOCK_SIZE)) -d $((150 * $BLOCK_SIZE)) -l $((25 * $BLOCK_SIZE)) \
> $SCRATCH_MNT/foo $SCRATCH_MNT/foo
>
> -# At this point there's only one reference to the 40K extent, at file offset
> -# 2M + 460K, we have 4 references for the prealloc extent (2 for file offset
> -# 160K and 2 for file offset 2M) and 2 references for the 100K extent (1 for
> -# file offset 3M and a new one for file offset 600K).
> +# At this point there's only one reference to the 10 block extent, at file
> +# offset mapped by (512 + 115) block, we have 4 references for the prealloc
> +# extent (2 for file offset mapped by 40th block and 2 for file offset mapped by
> +# 512th block) and 2 references for the 25 block extent (1 for file offset
> +# mapped by 768th block and a new one for file offset mapped by 150th block).
>
> # Now fsync our file to make all its new data and metadata updates are durably
> # persisted and present if a power failure/crash happens after a successful
> # fsync and before the next transaction commit.
> $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
>
> -echo "File digest before power failure:"
> -md5sum $SCRATCH_MNT/foo | _filter_scratch
> +echo "File contents before power failure:"
> +od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # During log replay, the btrfs delayed references implementation used to run the
> # deletion of back references before the addition of new back references, which
> # made the addition fail as it didn't find the key in the extent tree that it
> -# was looking for. The failure triggered by this test was related to the 40K
> -# extent, which got 1 reference dropped and 1 reference added during the fsync
> -# log replay - when running the delayed references at transaction commit time,
> -# btrfs was applying the deletion before the insertion, resulting in a failure
> -# of the insertion that ended up turning the fs into read-only mode.
> +# was looking for. The failure triggered by this test was related to the 10
> +# block extent, which got 1 reference dropped and 1 reference added during the
> +# fsync log replay - when running the delayed references at transaction commit
> +# time, btrfs was applying the deletion before the insertion, resulting in a
> +# failure of the insertion that ended up turning the fs into read-only mode.
> _flakey_drop_and_remount
>
> -echo "File digest after log replay:"
> -md5sum $SCRATCH_MNT/foo | _filter_scratch
> +echo "File contents after log replay:"
> +od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> _unmount_flakey
>
> diff --git a/tests/btrfs/095.out b/tests/btrfs/095.out
> index e93435c..e73b24d 100644
> --- a/tests/btrfs/095.out
> +++ b/tests/btrfs/095.out
> @@ -1,9 +1,35 @@
> QA output created by 095
> -wrote 122880/122880 bytes at offset 552960
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 102400/102400 bytes at offset 3145728
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digest before power failure:
> -beaf47c36659ac29bb9363fb8ffa10a1 SCRATCH_MNT/foo
> -File digest after log replay:
> -beaf47c36659ac29bb9363fb8ffa10a1 SCRATCH_MNT/foo
> +Blocks modified: [135 - 164]
> +Blocks modified: [768 - 792]
> +File contents before power failure:
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +207 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +226 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +257 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +1137 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +1175 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +1400 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +1431
> +File contents after log replay:
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +207 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +226 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +257 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +1137 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +1175 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +1400 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +1431
> --
> 2.1.0
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 5/8] Fix btrfs/097 to work on non-4k block sized filesystems
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
` (3 preceding siblings ...)
2015-11-30 10:17 ` [PATCH 4/8] Fix btrfs/095 " Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:27 ` Filipe Manana
2015-11-30 10:17 ` [PATCH 6/8] Fix btrfs/098 " Chandan Rajendra
` (2 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
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/097 | 41 ++++++++++++++++++++++++-----------------
tests/btrfs/097.out | 23 +++++++++++++++++------
2 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/tests/btrfs/097 b/tests/btrfs/097
index d9138ea..d1cfff1 100755
--- a/tests/btrfs/097
+++ b/tests/btrfs/097
@@ -57,22 +57,29 @@ mkdir $send_files_dir
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
-# Create our test file with a single extent of 64K starting at file offset 128K.
-$XFS_IO_PROG -f -c "pwrite -S 0xaa 128K 64K" $SCRATCH_MNT/foo | _filter_xfs_io
+BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
+
+# Create our test file with a single extent of 16 blocks starting at a file
+# offset mapped by 32nd block.
+$XFS_IO_PROG -f -c "pwrite -S 0xaa $((32 * $BLOCK_SIZE)) $((16 * $BLOCK_SIZE))" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
# Now clone parts of the original extent into lower offsets of the file.
#
# The first clone operation adds a file extent item to file offset 0 that points
-# to our initial extent with a data offset of 16K. The corresponding data back
-# reference in the extent tree has an offset of 18446744073709535232, which is
-# the result of file_offset - data_offset = 0 - 16K.
-#
-# The second clone operation adds a file extent item to file offset 16K that
-# points to our initial extent with a data offset of 48K. The corresponding data
-# back reference in the extent tree has an offset of 18446744073709518848, which
-# is the result of file_offset - data_offset = 16K - 48K.
+# to our initial extent with a data offset of 4 blocks. The corresponding data back
+# reference in the extent tree has a large value for the 'offset' field, which is
+# the result of file_offset - data_offset = 0 - (file offset of 4th block). For
+# example in case of 4k block size, it will be 0 - 16k = 18446744073709535232.
+
+# The second clone operation adds a file extent item to file offset mapped by
+# 4th block that points to our initial extent with a data offset of 12
+# blocks. The corresponding data back reference in the extent tree has a large
+# value for the 'offset' field, which is the result of file_offset - data_offset
+# = (file offset of 4th block) - (file offset of 12th block). For example in
+# case of 4k block size, it will be 16K - 48K = 18446744073709518848.
#
# Those large back reference offsets (result of unsigned arithmetic underflow)
# confused the back reference walking code (used by an incremental send and
@@ -83,10 +90,10 @@ _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
# "BTRFS error (device sdc): did not find backref in send_root. inode=257, \
# offset=0, disk_byte=12845056 found extent=12845056"
#
-$CLONER_PROG -s $(((128 + 16) * 1024)) -d 0 -l $((16 * 1024)) \
- $SCRATCH_MNT/foo $SCRATCH_MNT/foo
-$CLONER_PROG -s $(((128 + 48) * 1024)) -d $((16 * 1024)) -l $((16 * 1024)) \
+$CLONER_PROG -s $(((32 + 4) * $BLOCK_SIZE)) -d 0 -l $((4 * $BLOCK_SIZE)) \
$SCRATCH_MNT/foo $SCRATCH_MNT/foo
+$CLONER_PROG -s $(((32 + 12) * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \
+ -l $((4 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
@@ -94,8 +101,8 @@ _run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
_run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
-f $send_files_dir/2.snap
-echo "File digest in the original filesystem:"
-md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
+echo "File contents in the original filesystem:"
+od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
# Now recreate the filesystem by receiving both send streams and verify we get
# the same file contents that the original filesystem had.
@@ -106,8 +113,8 @@ _scratch_mount
_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
-echo "File digest in the new filesystem:"
-md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
+echo "File contents in the new filesystem:"
+od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
status=0
exit
diff --git a/tests/btrfs/097.out b/tests/btrfs/097.out
index 5e87eb2..aa9e549 100644
--- a/tests/btrfs/097.out
+++ b/tests/btrfs/097.out
@@ -1,7 +1,18 @@
QA output created by 097
-wrote 65536/65536 bytes at offset 131072
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digest in the original filesystem:
-6c6079335cff141b8a31233ead04cbff SCRATCH_MNT/mysnap2/foo
-File digest in the new filesystem:
-6c6079335cff141b8a31233ead04cbff SCRATCH_MNT/mysnap2/foo
+Blocks modified: [32 - 47]
+File contents in the original filesystem:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+40 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+60
+File contents in the new filesystem:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+40 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+60
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 5/8] Fix btrfs/097 to work on non-4k block sized filesystems
2015-11-30 10:17 ` [PATCH 5/8] Fix btrfs/097 " Chandan Rajendra
@ 2015-12-10 17:27 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:27 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> 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>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> tests/btrfs/097 | 41 ++++++++++++++++++++++++-----------------
> tests/btrfs/097.out | 23 +++++++++++++++++------
> 2 files changed, 41 insertions(+), 23 deletions(-)
>
> diff --git a/tests/btrfs/097 b/tests/btrfs/097
> index d9138ea..d1cfff1 100755
> --- a/tests/btrfs/097
> +++ b/tests/btrfs/097
> @@ -57,22 +57,29 @@ mkdir $send_files_dir
> _scratch_mkfs >>$seqres.full 2>&1
> _scratch_mount
>
> -# Create our test file with a single extent of 64K starting at file offset 128K.
> -$XFS_IO_PROG -f -c "pwrite -S 0xaa 128K 64K" $SCRATCH_MNT/foo | _filter_xfs_io
> +BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
> +
> +# Create our test file with a single extent of 16 blocks starting at a file
> +# offset mapped by 32nd block.
> +$XFS_IO_PROG -f -c "pwrite -S 0xaa $((32 * $BLOCK_SIZE)) $((16 * $BLOCK_SIZE))" \
> + $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
>
> _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
>
> # Now clone parts of the original extent into lower offsets of the file.
> #
> # The first clone operation adds a file extent item to file offset 0 that points
> -# to our initial extent with a data offset of 16K. The corresponding data back
> -# reference in the extent tree has an offset of 18446744073709535232, which is
> -# the result of file_offset - data_offset = 0 - 16K.
> -#
> -# The second clone operation adds a file extent item to file offset 16K that
> -# points to our initial extent with a data offset of 48K. The corresponding data
> -# back reference in the extent tree has an offset of 18446744073709518848, which
> -# is the result of file_offset - data_offset = 16K - 48K.
> +# to our initial extent with a data offset of 4 blocks. The corresponding data back
> +# reference in the extent tree has a large value for the 'offset' field, which is
> +# the result of file_offset - data_offset = 0 - (file offset of 4th block). For
> +# example in case of 4k block size, it will be 0 - 16k = 18446744073709535232.
> +
> +# The second clone operation adds a file extent item to file offset mapped by
> +# 4th block that points to our initial extent with a data offset of 12
> +# blocks. The corresponding data back reference in the extent tree has a large
> +# value for the 'offset' field, which is the result of file_offset - data_offset
> +# = (file offset of 4th block) - (file offset of 12th block). For example in
> +# case of 4k block size, it will be 16K - 48K = 18446744073709518848.
> #
> # Those large back reference offsets (result of unsigned arithmetic underflow)
> # confused the back reference walking code (used by an incremental send and
> @@ -83,10 +90,10 @@ _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
> # "BTRFS error (device sdc): did not find backref in send_root. inode=257, \
> # offset=0, disk_byte=12845056 found extent=12845056"
> #
> -$CLONER_PROG -s $(((128 + 16) * 1024)) -d 0 -l $((16 * 1024)) \
> - $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> -$CLONER_PROG -s $(((128 + 48) * 1024)) -d $((16 * 1024)) -l $((16 * 1024)) \
> +$CLONER_PROG -s $(((32 + 4) * $BLOCK_SIZE)) -d 0 -l $((4 * $BLOCK_SIZE)) \
> $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> +$CLONER_PROG -s $(((32 + 12) * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \
> + -l $((4 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
>
> _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
>
> @@ -94,8 +101,8 @@ _run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
> _run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
> -f $send_files_dir/2.snap
>
> -echo "File digest in the original filesystem:"
> -md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
> +echo "File contents in the original filesystem:"
> +od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
>
> # Now recreate the filesystem by receiving both send streams and verify we get
> # the same file contents that the original filesystem had.
> @@ -106,8 +113,8 @@ _scratch_mount
> _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
> _run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
>
> -echo "File digest in the new filesystem:"
> -md5sum $SCRATCH_MNT/mysnap2/foo | _filter_scratch
> +echo "File contents in the new filesystem:"
> +od -t x1 $SCRATCH_MNT/mysnap2/foo | _filter_od
>
> status=0
> exit
> diff --git a/tests/btrfs/097.out b/tests/btrfs/097.out
> index 5e87eb2..aa9e549 100644
> --- a/tests/btrfs/097.out
> +++ b/tests/btrfs/097.out
> @@ -1,7 +1,18 @@
> QA output created by 097
> -wrote 65536/65536 bytes at offset 131072
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digest in the original filesystem:
> -6c6079335cff141b8a31233ead04cbff SCRATCH_MNT/mysnap2/foo
> -File digest in the new filesystem:
> -6c6079335cff141b8a31233ead04cbff SCRATCH_MNT/mysnap2/foo
> +Blocks modified: [32 - 47]
> +File contents in the original filesystem:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +40 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +60
> +File contents in the new filesystem:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +40 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +60
> --
> 2.1.0
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 6/8] Fix btrfs/098 to work on non-4k block sized filesystems
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
` (4 preceding siblings ...)
2015-11-30 10:17 ` [PATCH 5/8] Fix btrfs/097 " Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:27 ` Filipe Manana
2015-11-30 10:17 ` [PATCH 7/8] Fix btrfs/103 " Chandan Rajendra
2015-11-30 10:17 ` [PATCH 8/8] Fix btrfs/106 to work on non-4k page sized machines Chandan Rajendra
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
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/098 | 67 +++++++++++++++++++++++++++++------------------------
tests/btrfs/098.out | 27 ++++++++++++++++-----
2 files changed, 58 insertions(+), 36 deletions(-)
diff --git a/tests/btrfs/098 b/tests/btrfs/098
index 8aef119..49f6d16 100755
--- a/tests/btrfs/098
+++ b/tests/btrfs/098
@@ -58,43 +58,50 @@ _scratch_mkfs >>$seqres.full 2>&1
_init_flakey
_mount_flakey
-# Create our test file with a single 100K extent starting at file offset 800K.
-# We fsync the file here to make the fsync log tree gets a single csum item that
-# covers the whole 100K extent, which causes the second fsync, done after the
-# cloning operation below, to not leave in the log tree two csum items covering
-# two sub-ranges ([0, 20K[ and [20K, 100K[)) of our extent.
-$XFS_IO_PROG -f -c "pwrite -S 0xaa 800K 100K" \
+BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
+
+# Create our test file with a single 25 block extent starting at file offset
+# mapped by 200th block We fsync the file here to make the fsync log tree get a
+# single csum item that covers the whole 25 block extent, which causes the
+# second fsync, done after the cloning operation below, to not leave in the log
+# tree two csum items covering two block sub-ranges ([0, 5[ and [5, 25[)) of our
+# extent.
+$XFS_IO_PROG -f -c "pwrite -S 0xaa $((200 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))" \
-c "fsync" \
- $SCRATCH_MNT/foo | _filter_xfs_io
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
+
-# Now clone part of our extent into file offset 400K. This adds a file extent
-# item to our inode's metadata that points to the 100K extent we created before,
-# using a data offset of 20K and a data length of 20K, so that it refers to
-# the sub-range [20K, 40K[ of our original extent.
-$CLONER_PROG -s $((800 * 1024 + 20 * 1024)) -d $((400 * 1024)) \
- -l $((20 * 1024)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+# Now clone part of our extent into file offset mapped by 100th block. This adds
+# a file extent item to our inode's metadata that points to the 25 block extent
+# we created before, using a data offset of 5 blocks and a data length of 5
+# blocks, so that it refers to the block sub-range [5, 10[ of our original
+# extent.
+$CLONER_PROG -s $(((200 * $BLOCK_SIZE) + (5 * $BLOCK_SIZE))) \
+ -d $((100 * $BLOCK_SIZE)) -l $((5 * $BLOCK_SIZE)) \
+ $SCRATCH_MNT/foo $SCRATCH_MNT/foo
# Now fsync our file to make sure the extent cloning is durably persisted. This
# fsync will not add a second csum item to the log tree containing the checksums
-# for the blocks in the sub-range [20K, 40K[ of our extent, because there was
+# for the blocks in the block sub-range [5, 10[ of our extent, because there was
# already a csum item in the log tree covering the whole extent, added by the
# first fsync we did before.
$XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
-echo "File digest before power failure:"
-md5sum $SCRATCH_MNT/foo | _filter_scratch
+echo "File contents before power failure:"
+od -t x1 $SCRATCH_MNT/foo | _filter_od
# The fsync log replay first processes the file extent item corresponding to the
-# file offset 400K (the one which refers to the [20K, 40K[ sub-range of our 100K
-# extent) and then processes the file extent item for file offset 800K. It used
-# to happen that when processing the later, it erroneously left in the csum tree
-# 2 csum items that overlapped each other, 1 for the sub-range [20K, 40K[ and 1
-# for the whole range of our extent. This introduced a problem where subsequent
-# lookups for the checksums of blocks within the range [40K, 100K[ of our extent
-# would not find anything because lookups in the csum tree ended up looking only
-# at the smaller csum item, the one covering the subrange [20K, 40K[. This made
-# read requests assume an expected checksum with a value of 0 for those blocks,
-# which caused checksum verification failure when the read operations finished.
+# file offset mapped by 100th block (the one which refers to the [5, 10[ block
+# sub-range of our 25 block extent) and then processes the file extent item for
+# file offset mapped by 200th block. It used to happen that when processing the
+# later, it erroneously left in the csum tree 2 csum items that overlapped each
+# other, 1 for the block sub-range [5, 10[ and 1 for the whole range of our
+# extent. This introduced a problem where subsequent lookups for the checksums
+# of blocks within the block range [10, 25[ of our extent would not find
+# anything because lookups in the csum tree ended up looking only at the smaller
+# csum item, the one covering the block subrange [5, 10[. This made read
+# requests assume an expected checksum with a value of 0 for those blocks, which
+# caused checksum verification failure when the read operations finished.
# However those checksum failure did not result in read requests returning an
# error to user space (like -EIO for e.g.) because the expected checksum value
# had the special value 0, and in that case btrfs set all bytes of the
@@ -106,10 +113,10 @@ md5sum $SCRATCH_MNT/foo | _filter_scratch
#
_flakey_drop_and_remount
-echo "File digest after log replay:"
-# Must match the same digest he had after cloning the extent and before the
-# power failure happened.
-md5sum $SCRATCH_MNT/foo | _filter_scratch
+echo "File contents after log replay:"
+# Must match the file contents we had after cloning the extent and before
+# the power failure happened.
+od -t x1 $SCRATCH_MNT/foo | _filter_od
_unmount_flakey
diff --git a/tests/btrfs/098.out b/tests/btrfs/098.out
index 3aa0772..98a96de 100644
--- a/tests/btrfs/098.out
+++ b/tests/btrfs/098.out
@@ -1,7 +1,22 @@
QA output created by 098
-wrote 102400/102400 bytes at offset 819200
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digest before power failure:
-39b386375971248740ed8651d5a2ed9f SCRATCH_MNT/foo
-File digest after log replay:
-39b386375971248740ed8651d5a2ed9f SCRATCH_MNT/foo
+Blocks modified: [200 - 224]
+File contents before power failure:
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+144 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+151 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+310 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+341
+File contents after log replay:
+0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+144 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+151 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+*
+310 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+341
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 6/8] Fix btrfs/098 to work on non-4k block sized filesystems
2015-11-30 10:17 ` [PATCH 6/8] Fix btrfs/098 " Chandan Rajendra
@ 2015-12-10 17:27 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:27 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> 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>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> tests/btrfs/098 | 67 +++++++++++++++++++++++++++++------------------------
> tests/btrfs/098.out | 27 ++++++++++++++++-----
> 2 files changed, 58 insertions(+), 36 deletions(-)
>
> diff --git a/tests/btrfs/098 b/tests/btrfs/098
> index 8aef119..49f6d16 100755
> --- a/tests/btrfs/098
> +++ b/tests/btrfs/098
> @@ -58,43 +58,50 @@ _scratch_mkfs >>$seqres.full 2>&1
> _init_flakey
> _mount_flakey
>
> -# Create our test file with a single 100K extent starting at file offset 800K.
> -# We fsync the file here to make the fsync log tree gets a single csum item that
> -# covers the whole 100K extent, which causes the second fsync, done after the
> -# cloning operation below, to not leave in the log tree two csum items covering
> -# two sub-ranges ([0, 20K[ and [20K, 100K[)) of our extent.
> -$XFS_IO_PROG -f -c "pwrite -S 0xaa 800K 100K" \
> +BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
> +
> +# Create our test file with a single 25 block extent starting at file offset
> +# mapped by 200th block We fsync the file here to make the fsync log tree get a
> +# single csum item that covers the whole 25 block extent, which causes the
> +# second fsync, done after the cloning operation below, to not leave in the log
> +# tree two csum items covering two block sub-ranges ([0, 5[ and [5, 25[)) of our
> +# extent.
> +$XFS_IO_PROG -f -c "pwrite -S 0xaa $((200 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))" \
> -c "fsync" \
> - $SCRATCH_MNT/foo | _filter_xfs_io
> + $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
> +
>
> -# Now clone part of our extent into file offset 400K. This adds a file extent
> -# item to our inode's metadata that points to the 100K extent we created before,
> -# using a data offset of 20K and a data length of 20K, so that it refers to
> -# the sub-range [20K, 40K[ of our original extent.
> -$CLONER_PROG -s $((800 * 1024 + 20 * 1024)) -d $((400 * 1024)) \
> - -l $((20 * 1024)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> +# Now clone part of our extent into file offset mapped by 100th block. This adds
> +# a file extent item to our inode's metadata that points to the 25 block extent
> +# we created before, using a data offset of 5 blocks and a data length of 5
> +# blocks, so that it refers to the block sub-range [5, 10[ of our original
> +# extent.
> +$CLONER_PROG -s $(((200 * $BLOCK_SIZE) + (5 * $BLOCK_SIZE))) \
> + -d $((100 * $BLOCK_SIZE)) -l $((5 * $BLOCK_SIZE)) \
> + $SCRATCH_MNT/foo $SCRATCH_MNT/foo
>
> # Now fsync our file to make sure the extent cloning is durably persisted. This
> # fsync will not add a second csum item to the log tree containing the checksums
> -# for the blocks in the sub-range [20K, 40K[ of our extent, because there was
> +# for the blocks in the block sub-range [5, 10[ of our extent, because there was
> # already a csum item in the log tree covering the whole extent, added by the
> # first fsync we did before.
> $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
>
> -echo "File digest before power failure:"
> -md5sum $SCRATCH_MNT/foo | _filter_scratch
> +echo "File contents before power failure:"
> +od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # The fsync log replay first processes the file extent item corresponding to the
> -# file offset 400K (the one which refers to the [20K, 40K[ sub-range of our 100K
> -# extent) and then processes the file extent item for file offset 800K. It used
> -# to happen that when processing the later, it erroneously left in the csum tree
> -# 2 csum items that overlapped each other, 1 for the sub-range [20K, 40K[ and 1
> -# for the whole range of our extent. This introduced a problem where subsequent
> -# lookups for the checksums of blocks within the range [40K, 100K[ of our extent
> -# would not find anything because lookups in the csum tree ended up looking only
> -# at the smaller csum item, the one covering the subrange [20K, 40K[. This made
> -# read requests assume an expected checksum with a value of 0 for those blocks,
> -# which caused checksum verification failure when the read operations finished.
> +# file offset mapped by 100th block (the one which refers to the [5, 10[ block
> +# sub-range of our 25 block extent) and then processes the file extent item for
> +# file offset mapped by 200th block. It used to happen that when processing the
> +# later, it erroneously left in the csum tree 2 csum items that overlapped each
> +# other, 1 for the block sub-range [5, 10[ and 1 for the whole range of our
> +# extent. This introduced a problem where subsequent lookups for the checksums
> +# of blocks within the block range [10, 25[ of our extent would not find
> +# anything because lookups in the csum tree ended up looking only at the smaller
> +# csum item, the one covering the block subrange [5, 10[. This made read
> +# requests assume an expected checksum with a value of 0 for those blocks, which
> +# caused checksum verification failure when the read operations finished.
> # However those checksum failure did not result in read requests returning an
> # error to user space (like -EIO for e.g.) because the expected checksum value
> # had the special value 0, and in that case btrfs set all bytes of the
> @@ -106,10 +113,10 @@ md5sum $SCRATCH_MNT/foo | _filter_scratch
> #
> _flakey_drop_and_remount
>
> -echo "File digest after log replay:"
> -# Must match the same digest he had after cloning the extent and before the
> -# power failure happened.
> -md5sum $SCRATCH_MNT/foo | _filter_scratch
> +echo "File contents after log replay:"
> +# Must match the file contents we had after cloning the extent and before
> +# the power failure happened.
> +od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> _unmount_flakey
>
> diff --git a/tests/btrfs/098.out b/tests/btrfs/098.out
> index 3aa0772..98a96de 100644
> --- a/tests/btrfs/098.out
> +++ b/tests/btrfs/098.out
> @@ -1,7 +1,22 @@
> QA output created by 098
> -wrote 102400/102400 bytes at offset 819200
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digest before power failure:
> -39b386375971248740ed8651d5a2ed9f SCRATCH_MNT/foo
> -File digest after log replay:
> -39b386375971248740ed8651d5a2ed9f SCRATCH_MNT/foo
> +Blocks modified: [200 - 224]
> +File contents before power failure:
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +144 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +151 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +310 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +341
> +File contents after log replay:
> +0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +144 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +151 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> +*
> +310 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +341
> --
> 2.1.0
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 7/8] Fix btrfs/103 to work on non-4k block sized filesystems
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
` (5 preceding siblings ...)
2015-11-30 10:17 ` [PATCH 6/8] Fix btrfs/098 " Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:27 ` Filipe Manana
2015-11-30 10:17 ` [PATCH 8/8] Fix btrfs/106 to work on non-4k page sized machines Chandan Rajendra
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
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/103 | 44 +++++++++++-------
tests/btrfs/103.out | 132 ++++++++++++++++++++++++++++++++++++++--------------
2 files changed, 122 insertions(+), 54 deletions(-)
diff --git a/tests/btrfs/103 b/tests/btrfs/103
index 3020c86..9d11d0f 100755
--- a/tests/btrfs/103
+++ b/tests/btrfs/103
@@ -56,31 +56,37 @@ test_clone_and_read_compressed_extent()
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount $mount_opts
+ BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
+
# Create a test file with a single extent that is compressed (the
# data we write into it is highly compressible no matter which
# compression algorithm is used, zlib or lzo).
- $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 4K" \
- -c "pwrite -S 0xbb 4K 8K" \
- -c "pwrite -S 0xcc 12K 4K" \
- $SCRATCH_MNT/foo | _filter_xfs_io
+ $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K $((1 * $BLOCK_SIZE))" \
+ -c "pwrite -S 0xbb $((1 * $BLOCK_SIZE)) $((2 * $BLOCK_SIZE))" \
+ -c "pwrite -S 0xcc $((3 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
+
# Now clone our extent into an adjacent offset.
- $CLONER_PROG -s $((4 * 1024)) -d $((16 * 1024)) -l $((8 * 1024)) \
- $SCRATCH_MNT/foo $SCRATCH_MNT/foo
+ $CLONER_PROG -s $((1 * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \
+ -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
# Same as before but for this file we clone the extent into a lower
# file offset.
- $XFS_IO_PROG -f -c "pwrite -S 0xaa 8K 4K" \
- -c "pwrite -S 0xbb 12K 8K" \
- -c "pwrite -S 0xcc 20K 4K" \
- $SCRATCH_MNT/bar | _filter_xfs_io
+ $XFS_IO_PROG -f \
+ -c "pwrite -S 0xaa $((2 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \
+ -c "pwrite -S 0xbb $((3 * $BLOCK_SIZE)) $((2 * $BLOCK_SIZE))" \
+ -c "pwrite -S 0xcc $((5 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \
+ $SCRATCH_MNT/bar | _filter_xfs_io_blocks_modified
- $CLONER_PROG -s $((12 * 1024)) -d 0 -l $((8 * 1024)) \
+ $CLONER_PROG -s $((3 * $BLOCK_SIZE)) -d 0 -l $((2 * $BLOCK_SIZE)) \
$SCRATCH_MNT/bar $SCRATCH_MNT/bar
- echo "File digests before unmounting filesystem:"
- md5sum $SCRATCH_MNT/foo | _filter_scratch
- md5sum $SCRATCH_MNT/bar | _filter_scratch
+ echo "File contents before unmounting filesystem:"
+ echo "foo:"
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
+ echo "bar:"
+ od -t x1 $SCRATCH_MNT/bar | _filter_od
# Evicting the inode or clearing the page cache before reading again
# the file would also trigger the bug - reads were returning all bytes
@@ -91,10 +97,12 @@ test_clone_and_read_compressed_extent()
# ranges that point to the same compressed extent.
_scratch_remount
- echo "File digests after mounting filesystem again:"
- # Must match the same digests we got before.
- md5sum $SCRATCH_MNT/foo | _filter_scratch
- md5sum $SCRATCH_MNT/bar | _filter_scratch
+ echo "File contents after mounting filesystem again:"
+ # Must match the same contents we got before.
+ echo "foo:"
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
+ echo "bar:"
+ od -t x1 $SCRATCH_MNT/bar | _filter_od
}
echo -e "\nTesting with zlib compression..."
diff --git a/tests/btrfs/103.out b/tests/btrfs/103.out
index f62de2f..8e31b5f 100644
--- a/tests/btrfs/103.out
+++ b/tests/btrfs/103.out
@@ -1,41 +1,101 @@
QA output created by 103
Testing with zlib compression...
-wrote 4096/4096 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 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 12288
-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 8192/8192 bytes at offset 12288
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 20480
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digests before unmounting filesystem:
-4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
-fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
-File digests after mounting filesystem again:
-4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
-fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
+Blocks modified: [0 - 0]
+Blocks modified: [1 - 2]
+Blocks modified: [3 - 3]
+Blocks modified: [2 - 2]
+Blocks modified: [3 - 4]
+Blocks modified: [5 - 5]
+File contents before unmounting filesystem:
+foo:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+6
+bar:
+0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+6
+File contents after mounting filesystem again:
+foo:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+6
+bar:
+0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+6
Testing with lzo compression...
-wrote 4096/4096 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 8192/8192 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 12288
-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 8192/8192 bytes at offset 12288
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 20480
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digests before unmounting filesystem:
-4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
-fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
-File digests after mounting filesystem again:
-4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
-fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
+Blocks modified: [0 - 0]
+Blocks modified: [1 - 2]
+Blocks modified: [3 - 3]
+Blocks modified: [2 - 2]
+Blocks modified: [3 - 4]
+Blocks modified: [5 - 5]
+File contents before unmounting filesystem:
+foo:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+6
+bar:
+0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+6
+File contents after mounting filesystem again:
+foo:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+6
+bar:
+0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
+*
+5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
+*
+6
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 7/8] Fix btrfs/103 to work on non-4k block sized filesystems
2015-11-30 10:17 ` [PATCH 7/8] Fix btrfs/103 " Chandan Rajendra
@ 2015-12-10 17:27 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:27 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> 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>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> tests/btrfs/103 | 44 +++++++++++-------
> tests/btrfs/103.out | 132 ++++++++++++++++++++++++++++++++++++++--------------
> 2 files changed, 122 insertions(+), 54 deletions(-)
>
> diff --git a/tests/btrfs/103 b/tests/btrfs/103
> index 3020c86..9d11d0f 100755
> --- a/tests/btrfs/103
> +++ b/tests/btrfs/103
> @@ -56,31 +56,37 @@ test_clone_and_read_compressed_extent()
> _scratch_mkfs >>$seqres.full 2>&1
> _scratch_mount $mount_opts
>
> + BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
> +
> # Create a test file with a single extent that is compressed (the
> # data we write into it is highly compressible no matter which
> # compression algorithm is used, zlib or lzo).
> - $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 4K" \
> - -c "pwrite -S 0xbb 4K 8K" \
> - -c "pwrite -S 0xcc 12K 4K" \
> - $SCRATCH_MNT/foo | _filter_xfs_io
> + $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K $((1 * $BLOCK_SIZE))" \
> + -c "pwrite -S 0xbb $((1 * $BLOCK_SIZE)) $((2 * $BLOCK_SIZE))" \
> + -c "pwrite -S 0xcc $((3 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \
> + $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified
> +
>
> # Now clone our extent into an adjacent offset.
> - $CLONER_PROG -s $((4 * 1024)) -d $((16 * 1024)) -l $((8 * 1024)) \
> - $SCRATCH_MNT/foo $SCRATCH_MNT/foo
> + $CLONER_PROG -s $((1 * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \
> + -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo
>
> # Same as before but for this file we clone the extent into a lower
> # file offset.
> - $XFS_IO_PROG -f -c "pwrite -S 0xaa 8K 4K" \
> - -c "pwrite -S 0xbb 12K 8K" \
> - -c "pwrite -S 0xcc 20K 4K" \
> - $SCRATCH_MNT/bar | _filter_xfs_io
> + $XFS_IO_PROG -f \
> + -c "pwrite -S 0xaa $((2 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \
> + -c "pwrite -S 0xbb $((3 * $BLOCK_SIZE)) $((2 * $BLOCK_SIZE))" \
> + -c "pwrite -S 0xcc $((5 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \
> + $SCRATCH_MNT/bar | _filter_xfs_io_blocks_modified
>
> - $CLONER_PROG -s $((12 * 1024)) -d 0 -l $((8 * 1024)) \
> + $CLONER_PROG -s $((3 * $BLOCK_SIZE)) -d 0 -l $((2 * $BLOCK_SIZE)) \
> $SCRATCH_MNT/bar $SCRATCH_MNT/bar
>
> - echo "File digests before unmounting filesystem:"
> - md5sum $SCRATCH_MNT/foo | _filter_scratch
> - md5sum $SCRATCH_MNT/bar | _filter_scratch
> + echo "File contents before unmounting filesystem:"
> + echo "foo:"
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
> + echo "bar:"
> + od -t x1 $SCRATCH_MNT/bar | _filter_od
>
> # Evicting the inode or clearing the page cache before reading again
> # the file would also trigger the bug - reads were returning all bytes
> @@ -91,10 +97,12 @@ test_clone_and_read_compressed_extent()
> # ranges that point to the same compressed extent.
> _scratch_remount
>
> - echo "File digests after mounting filesystem again:"
> - # Must match the same digests we got before.
> - md5sum $SCRATCH_MNT/foo | _filter_scratch
> - md5sum $SCRATCH_MNT/bar | _filter_scratch
> + echo "File contents after mounting filesystem again:"
> + # Must match the same contents we got before.
> + echo "foo:"
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
> + echo "bar:"
> + od -t x1 $SCRATCH_MNT/bar | _filter_od
> }
>
> echo -e "\nTesting with zlib compression..."
> diff --git a/tests/btrfs/103.out b/tests/btrfs/103.out
> index f62de2f..8e31b5f 100644
> --- a/tests/btrfs/103.out
> +++ b/tests/btrfs/103.out
> @@ -1,41 +1,101 @@
> QA output created by 103
>
> Testing with zlib compression...
> -wrote 4096/4096 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 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 12288
> -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 8192/8192 bytes at offset 12288
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 4096/4096 bytes at offset 20480
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digests before unmounting filesystem:
> -4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
> -fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
> -File digests after mounting filesystem again:
> -4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
> -fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
> +Blocks modified: [0 - 0]
> +Blocks modified: [1 - 2]
> +Blocks modified: [3 - 3]
> +Blocks modified: [2 - 2]
> +Blocks modified: [3 - 4]
> +Blocks modified: [5 - 5]
> +File contents before unmounting filesystem:
> +foo:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +6
> +bar:
> +0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +6
> +File contents after mounting filesystem again:
> +foo:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +6
> +bar:
> +0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +6
>
> Testing with lzo compression...
> -wrote 4096/4096 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8192/8192 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 12288
> -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 8192/8192 bytes at offset 12288
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 4096/4096 bytes at offset 20480
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digests before unmounting filesystem:
> -4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
> -fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
> -File digests after mounting filesystem again:
> -4b985a45790261a706c3ddbf22c5f765 SCRATCH_MNT/foo
> -fd331e6b7a9ab105f48f71b53162d5b5 SCRATCH_MNT/bar
> +Blocks modified: [0 - 0]
> +Blocks modified: [1 - 2]
> +Blocks modified: [3 - 3]
> +Blocks modified: [2 - 2]
> +Blocks modified: [3 - 4]
> +Blocks modified: [5 - 5]
> +File contents before unmounting filesystem:
> +foo:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +6
> +bar:
> +0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +6
> +File contents after mounting filesystem again:
> +foo:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +1 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +4 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +6
> +bar:
> +0 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +2 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +3 bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb
> +*
> +5 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
> +*
> +6
> --
> 2.1.0
>
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 8/8] Fix btrfs/106 to work on non-4k page sized machines
2015-11-30 10:17 [PATCH 0/8] PART 2: Fix Btrfs tests to work on non-4k block sized fs instances Chandan Rajendra
` (6 preceding siblings ...)
2015-11-30 10:17 ` [PATCH 7/8] Fix btrfs/103 " Chandan Rajendra
@ 2015-11-30 10:17 ` Chandan Rajendra
2015-12-10 17:28 ` Filipe Manana
7 siblings, 1 reply; 17+ messages in thread
From: Chandan Rajendra @ 2015-11-30 10:17 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-btrfs, fdmanana, chandan
This commit makes use of the new _filter_xfs_io_pages_modified filtering
function to print information in terms of page size units rather than file
offset.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
tests/btrfs/106 | 36 ++++++++++++++++++++----------------
tests/btrfs/106.out | 30 ++++++++++++++++++------------
2 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/tests/btrfs/106 b/tests/btrfs/106
index 1670453..30c43fa 100755
--- a/tests/btrfs/106
+++ b/tests/btrfs/106
@@ -58,31 +58,35 @@ test_clone_and_read_compressed_extent()
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount $mount_opts
- # Create our test file with a single extent of 64Kb that is going to be
- # compressed no matter which compression algorithm is used (zlib/lzo).
- $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 64K" \
- $SCRATCH_MNT/foo | _filter_xfs_io
+ PAGE_SIZE=$(get_page_size)
+
+ # Create our test file with 16 pages worth of data in a single extent
+ # that is going to be compressed no matter which compression algorithm
+ # is used (zlib/lzo).
+ $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K $((16 * $PAGE_SIZE))" \
+ $SCRATCH_MNT/foo | _filter_xfs_io_pages_modified
# Now clone the compressed extent into an adjacent file offset.
- $CLONER_PROG -s 0 -d $((64 * 1024)) -l $((64 * 1024)) \
+ $CLONER_PROG -s 0 -d $((16 * $PAGE_SIZE)) -l $((16 * $PAGE_SIZE)) \
$SCRATCH_MNT/foo $SCRATCH_MNT/foo
- echo "File digest before unmount:"
- md5sum $SCRATCH_MNT/foo | _filter_scratch
+ echo "File contents before unmount:"
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
# Remount the fs or clear the page cache to trigger the bug in btrfs.
- # Because the extent has an uncompressed length that is a multiple of
- # 16 pages, all the pages belonging to the second range of the file
- # (64K to 128K), which points to the same extent as the first range
- # (0K to 64K), had their contents full of zeroes instead of the byte
- # 0xaa. This was a bug exclusively in the read path of compressed
- # extents, the correct data was stored on disk, btrfs just failed to
- # fill in the pages correctly.
+ # Because the extent has an uncompressed length that is a multiple of 16
+ # pages, all the pages belonging to the second range of the file that is
+ # mapped by the page index range [16, 31], which points to the same
+ # extent as the first file range mapped by the page index range [0, 15],
+ # had their contents full of zeroes instead of the byte 0xaa. This was a
+ # bug exclusively in the read path of compressed extents, the correct
+ # data was stored on disk, btrfs just failed to fill in the pages
+ # correctly.
_scratch_remount
- echo "File digest after remount:"
+ echo "File contents after remount:"
# Must match the digest we got before.
- md5sum $SCRATCH_MNT/foo | _filter_scratch
+ od -t x1 $SCRATCH_MNT/foo | _filter_od
}
echo -e "\nTesting with zlib compression..."
diff --git a/tests/btrfs/106.out b/tests/btrfs/106.out
index 692108d..1144a82 100644
--- a/tests/btrfs/106.out
+++ b/tests/btrfs/106.out
@@ -1,17 +1,23 @@
QA output created by 106
Testing with zlib compression...
-wrote 65536/65536 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digest before unmount:
-be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
-File digest after remount:
-be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
+Pages modified: [0 - 15]
+File contents before unmount:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+40
+File contents after remount:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+40
Testing with lzo compression...
-wrote 65536/65536 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-File digest before unmount:
-be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
-File digest after remount:
-be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
+Pages modified: [0 - 15]
+File contents before unmount:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+40
+File contents after remount:
+0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
+*
+40
--
2.1.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH 8/8] Fix btrfs/106 to work on non-4k page sized machines
2015-11-30 10:17 ` [PATCH 8/8] Fix btrfs/106 to work on non-4k page sized machines Chandan Rajendra
@ 2015-12-10 17:28 ` Filipe Manana
0 siblings, 0 replies; 17+ messages in thread
From: Filipe Manana @ 2015-12-10 17:28 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-btrfs@vger.kernel.org, chandan
On Mon, Nov 30, 2015 at 10:17 AM, Chandan Rajendra
<chandan@linux.vnet.ibm.com> wrote:
> This commit makes use of the new _filter_xfs_io_pages_modified filtering
> function to print information in terms of page size units rather than file
> offset.
>
> Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Thanks!
> ---
> tests/btrfs/106 | 36 ++++++++++++++++++++----------------
> tests/btrfs/106.out | 30 ++++++++++++++++++------------
> 2 files changed, 38 insertions(+), 28 deletions(-)
>
> diff --git a/tests/btrfs/106 b/tests/btrfs/106
> index 1670453..30c43fa 100755
> --- a/tests/btrfs/106
> +++ b/tests/btrfs/106
> @@ -58,31 +58,35 @@ test_clone_and_read_compressed_extent()
> _scratch_mkfs >>$seqres.full 2>&1
> _scratch_mount $mount_opts
>
> - # Create our test file with a single extent of 64Kb that is going to be
> - # compressed no matter which compression algorithm is used (zlib/lzo).
> - $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 64K" \
> - $SCRATCH_MNT/foo | _filter_xfs_io
> + PAGE_SIZE=$(get_page_size)
> +
> + # Create our test file with 16 pages worth of data in a single extent
> + # that is going to be compressed no matter which compression algorithm
> + # is used (zlib/lzo).
> + $XFS_IO_PROG -f -c "pwrite -S 0xaa 0K $((16 * $PAGE_SIZE))" \
> + $SCRATCH_MNT/foo | _filter_xfs_io_pages_modified
>
> # Now clone the compressed extent into an adjacent file offset.
> - $CLONER_PROG -s 0 -d $((64 * 1024)) -l $((64 * 1024)) \
> + $CLONER_PROG -s 0 -d $((16 * $PAGE_SIZE)) -l $((16 * $PAGE_SIZE)) \
> $SCRATCH_MNT/foo $SCRATCH_MNT/foo
>
> - echo "File digest before unmount:"
> - md5sum $SCRATCH_MNT/foo | _filter_scratch
> + echo "File contents before unmount:"
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
>
> # Remount the fs or clear the page cache to trigger the bug in btrfs.
> - # Because the extent has an uncompressed length that is a multiple of
> - # 16 pages, all the pages belonging to the second range of the file
> - # (64K to 128K), which points to the same extent as the first range
> - # (0K to 64K), had their contents full of zeroes instead of the byte
> - # 0xaa. This was a bug exclusively in the read path of compressed
> - # extents, the correct data was stored on disk, btrfs just failed to
> - # fill in the pages correctly.
> + # Because the extent has an uncompressed length that is a multiple of 16
> + # pages, all the pages belonging to the second range of the file that is
> + # mapped by the page index range [16, 31], which points to the same
> + # extent as the first file range mapped by the page index range [0, 15],
> + # had their contents full of zeroes instead of the byte 0xaa. This was a
> + # bug exclusively in the read path of compressed extents, the correct
> + # data was stored on disk, btrfs just failed to fill in the pages
> + # correctly.
> _scratch_remount
>
> - echo "File digest after remount:"
> + echo "File contents after remount:"
> # Must match the digest we got before.
> - md5sum $SCRATCH_MNT/foo | _filter_scratch
> + od -t x1 $SCRATCH_MNT/foo | _filter_od
> }
>
> echo -e "\nTesting with zlib compression..."
> diff --git a/tests/btrfs/106.out b/tests/btrfs/106.out
> index 692108d..1144a82 100644
> --- a/tests/btrfs/106.out
> +++ b/tests/btrfs/106.out
> @@ -1,17 +1,23 @@
> QA output created by 106
>
> Testing with zlib compression...
> -wrote 65536/65536 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digest before unmount:
> -be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
> -File digest after remount:
> -be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
> +Pages modified: [0 - 15]
> +File contents before unmount:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +40
> +File contents after remount:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +40
>
> Testing with lzo compression...
> -wrote 65536/65536 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -File digest before unmount:
> -be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
> -File digest after remount:
> -be68df46e3cf60b559376a35f9fbb05d SCRATCH_MNT/foo
> +Pages modified: [0 - 15]
> +File contents before unmount:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +40
> +File contents after remount:
> +0 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
> +*
> +40
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Filipe David Manana,
"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."
^ permalink raw reply [flat|nested] 17+ messages in thread