Re: [PATCH] _test_generic_punch: Extend $testfile's size to work with 64k block.

2013-08-13 Thread chandan
Hello Dave,

 So, to do this properly, I'd suggest that the code needs to scale
 the offset/size of the IO being done by the filesystem block size,
 not use a fixed size. Using a filter on the bmap output to handle
 the different block ranges will ensure everything works correctly
 from a golden output POV, except for one thing - the md5sum.
 
Yes, we did try the approach of using variable block size and scaling
the offset values in the filter function. But we got stuck
working with md5sum (since we would need two sets of md5sums (with and
without '-k' option) per block size). As suggested, I will be
reposting the patch to use _requires_le_4k_blocksize.

chandan

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


[PATCH] _test_generic_punch: Extend $testfile's size to work with 64k block.

2013-08-08 Thread chandan
From cf6e1fc3a8d7806a97055b5f483cf50f58c8294f Mon Sep 17 00:00:00 2001
From: chandan chan...@linux.vnet.ibm.com
Date: Thu, 8 Aug 2013 11:33:10 +0530
Subject: [PATCH] _test_generic_punch: Extend $testfile's size to work with 64k
 block.

The current script does not work with 64k block size. This patch fixes it
by creating a larger $testfile.

Signed-off-by: chandan chan...@linux.vnet.ibm.com
---
 common/punch  | 119 +++--
 tests/generic/255.out | 476 +-
 tests/xfs/242.out | 118 ++---
 tests/xfs/252.out | 476 +-
 4 files changed, 594 insertions(+), 595 deletions(-)

diff --git a/common/punch b/common/punch
index d8f73d0..e6f0b2a 100644
--- a/common/punch
+++ b/common/punch
@@ -316,8 +316,8 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -326,9 +326,9 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c pwrite 0 20k $sync_cmd \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c pwrite 0 320k $sync_cmd \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -337,9 +337,9 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c $alloc_cmd 0 20k \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c $alloc_cmd 0 320k \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -348,9 +348,9 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c pwrite 8k 8k $sync_cmd \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c pwrite 128k 128k $sync_cmd \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -359,9 +359,9 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c $alloc_cmd 8k 8k \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c $alloc_cmd 128k 128k \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -370,9 +370,9 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c pwrite 0 8k $sync_cmd \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c pwrite 0 128k $sync_cmd \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -381,10 +381,10 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c pwrite 0 8k $sync_cmd \
-   -c $alloc_cmd 8k 8k \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c pwrite 0 128k $sync_cmd \
+   -c $alloc_cmd 128k 128k \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -393,9 +393,9 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c $alloc_cmd 0 8k \
-   -c $zero_cmd 4k 8k \
+   $XFS_IO_PROG -f -c truncate 320k \
+   -c $alloc_cmd 0 128k \
+   -c $zero_cmd 64k 128k \
-c $map_cmd -v $testfile | $filter_cmd
[ $? -ne 0 ]  die_now
_md5_checksum $testfile
@@ -404,10 +404,10 @@ _test_generic_punch()
if [ $remove_testfile ]; then
rm -f $testfile
fi
-   $XFS_IO_PROG -f -c truncate 20k \
-   -c $alloc_cmd 0 8k \
-   -c pwrite 8k 8k $sync_cmd \
-   -c $zero_cmd 4k 8k