* [PATCH 1/2] fstests: btrfs/011 use replace_options @ 2016-02-19 13:25 Anand Jain 2016-02-19 13:25 ` [PATCH 2/2] fstests: btrfs/011 add debug logs to seqres.full Anand Jain 2016-02-24 12:42 ` [PATCH 1/2] fstests: btrfs/011 use replace_options David Sterba 0 siblings, 2 replies; 6+ messages in thread From: Anand Jain @ 2016-02-19 13:25 UTC (permalink / raw) To: fstests; +Cc: linux-btrfs, Anand Jain This patch fixes test btrfs/011 which intended to use -r option but was never used since its associated args 'replace_options' didn't make it to the cli. Signed-off-by: Anand Jain <anand.jain@oracle.com> --- tests/btrfs/011 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/btrfs/011 b/tests/btrfs/011 index 72c53abfbed0..3bc7f0af70a3 100755 --- a/tests/btrfs/011 +++ b/tests/btrfs/011 @@ -220,7 +220,7 @@ btrfs_replace_test() if [ "${with_cancel}Q" = "cancelQ" ]; then # background the replace operation (no '-B' option given) - $BTRFS_UTIL_PROG replace start -f $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" + $BTRFS_UTIL_PROG replace start -f $replace_options $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" sleep 1 $BTRFS_UTIL_PROG replace cancel $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace cancel failed" @@ -236,7 +236,7 @@ btrfs_replace_test() # a sync in the middle of the replace operation. (sleep 1; sync) > /dev/null 2>&1 & fi - $BTRFS_UTIL_PROG replace start -Bf $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" + $BTRFS_UTIL_PROG replace start -Bf $replace_options $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" $BTRFS_UTIL_PROG replace status $SCRATCH_MNT > $tmp.tmp 2>&1 cat $tmp.tmp >> $seqres.full -- 2.7.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] fstests: btrfs/011 add debug logs to seqres.full 2016-02-19 13:25 [PATCH 1/2] fstests: btrfs/011 use replace_options Anand Jain @ 2016-02-19 13:25 ` Anand Jain 2016-03-09 9:53 ` [PATCH v2 " Anand Jain 2016-02-24 12:42 ` [PATCH 1/2] fstests: btrfs/011 use replace_options David Sterba 1 sibling, 1 reply; 6+ messages in thread From: Anand Jain @ 2016-02-19 13:25 UTC (permalink / raw) To: fstests; +Cc: linux-btrfs, Anand Jain Signed-off-by: Anand Jain <anand.jain@oracle.com> --- tests/btrfs/011 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/btrfs/011 b/tests/btrfs/011 index 3bc7f0af70a3..8cf6ff265aa5 100755 --- a/tests/btrfs/011 +++ b/tests/btrfs/011 @@ -80,6 +80,9 @@ workout() local target_dev="`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`" local fssize + echo >> $seqres.full + echo "---------workout \"$1\" $2 $3 $4-----------" >> $seqres.full + if [ "`echo $SCRATCH_DEV_POOL | wc -w`" -lt `expr $num_devs4raid + 1` ]; then echo "Skip workout $1 $2 $3 $4" >> $seqres.full echo "Too few devices in SCRATCH_DEV_POOL $SCRATCH_DEV_POOL, required: " `expr $num_devs4raid + 1` >> $seqres.full @@ -114,6 +117,9 @@ workout() _scratch_mount + echo "$BTRFS_UTIL_PROG filesystem show" >> $seqres.full + $BTRFS_UTIL_PROG filesystem show >> $seqres.full + # Generate metadata and some minimal user data, generate 500 times # 20K extents in the data chunk and fill up metadata with inline # extents. @@ -220,8 +226,10 @@ btrfs_replace_test() if [ "${with_cancel}Q" = "cancelQ" ]; then # background the replace operation (no '-B' option given) + echo "$BTRFS_UTIL_PROG replace start -f $replace_options $source_dev $target_dev $SCRATCH_MNT" >> $seqres.full $BTRFS_UTIL_PROG replace start -f $replace_options $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" sleep 1 + echo "$BTRFS_UTIL_PROG replace cancel $SCRATCH_MNT" >> $seqres.full $BTRFS_UTIL_PROG replace cancel $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace cancel failed" # 'replace status' waits for the replace operation to finish @@ -236,6 +244,7 @@ btrfs_replace_test() # a sync in the middle of the replace operation. (sleep 1; sync) > /dev/null 2>&1 & fi + echo "$BTRFS_UTIL_PROG replace start -Bf $replace_options $source_dev $target_dev $SCRATCH_MNT" >> $seqres.full $BTRFS_UTIL_PROG replace start -Bf $replace_options $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" $BTRFS_UTIL_PROG replace status $SCRATCH_MNT > $tmp.tmp 2>&1 @@ -267,6 +276,11 @@ btrfs_replace_test() _scratch_unmount > /dev/null 2>&1 if [ "${with_cancel}Q" != "cancelQ" ]; then # after the replace operation, use the target_dev for everything + echo "$BTRFS_UTIL_PROG filesystem show -d" >> $seqres.full + $BTRFS_UTIL_PROG filesystem show -d >> $seqres.full + echo "$BTRFS_UTIL_PROG filesystem show" >> $seqres.full + $BTRFS_UTIL_PROG filesystem show >> $seqres.full + echo "_check_btrfs_filesystem $target_dev" >> $seqres.full _check_btrfs_filesystem $target_dev _mount -t $FSTYP `_scratch_mount_options | sed "s&${SCRATCH_DEV}&${target_dev}&"` else -- 2.7.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] fstests: btrfs/011 add debug logs to seqres.full 2016-02-19 13:25 ` [PATCH 2/2] fstests: btrfs/011 add debug logs to seqres.full Anand Jain @ 2016-03-09 9:53 ` Anand Jain 0 siblings, 0 replies; 6+ messages in thread From: Anand Jain @ 2016-03-09 9:53 UTC (permalink / raw) To: fstests; +Cc: linux-btrfs Adds debug logs to $seqres.full and as the btrfs fi show command shows unwanted extra errors from the previous test defunct volumes, avoid this by adding wipefs -a of scratch_pool_device before the each sub test case. Signed-off-by: Anand Jain <anand.jain@oracle.com> --- v2: Commit update and, Add wipefs for each of the scratch_pool_device, so that we circumvent a known issue about the 'btrfs fi show' that it reports extra warnings/errors about the defunct volumes. common/rc | 10 ++++++++++ tests/btrfs/011 | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/common/rc b/common/rc index 52c4a36ec8d9..4c6ec2d6448f 100644 --- a/common/rc +++ b/common/rc @@ -783,6 +783,16 @@ _scratch_pool_mkfs() esac } +_scratch_pool_wipe() +{ + local sdp + + for sdp in ${SCRATCH_DEV_POOL}; do + echo "$WIPEFS_PROG -a ${sdp}" >> $seqres.full + $WIPEFS_PROG -a ${sdp} > /dev/null 2>&1 + done +} + # Create fs of certain size on scratch device # _scratch_mkfs_sized <size in bytes> [optional blocksize] _scratch_mkfs_sized() diff --git a/tests/btrfs/011 b/tests/btrfs/011 index 3bc7f0af70a3..e93ab8769536 100755 --- a/tests/btrfs/011 +++ b/tests/btrfs/011 @@ -64,6 +64,7 @@ _supported_fs btrfs _require_scratch_nocheck _require_scratch_dev_pool 4 _require_command "$BTRFS_SHOW_SUPER_PROG" btrfs-show-super +_require_command "$WIPEFS_PROG" wipefs rm -f $seqres.full rm -f $tmp.tmp @@ -80,6 +81,11 @@ workout() local target_dev="`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`" local fssize + _scratch_pool_wipe + + echo >> $seqres.full + echo "---------workout \"$1\" $2 $3 $4-----------" >> $seqres.full + if [ "`echo $SCRATCH_DEV_POOL | wc -w`" -lt `expr $num_devs4raid + 1` ]; then echo "Skip workout $1 $2 $3 $4" >> $seqres.full echo "Too few devices in SCRATCH_DEV_POOL $SCRATCH_DEV_POOL, required: " `expr $num_devs4raid + 1` >> $seqres.full @@ -112,8 +118,14 @@ workout() _notrun "device size too small" fi + # Since mkfs on target_dev was only to find size, wipefs after about + # size is done + $WIPEFS_PROG -a ${target_dev} > /dev/null 2>&1 _scratch_mount + echo "$BTRFS_UTIL_PROG filesystem show (1)" >> $seqres.full + $BTRFS_UTIL_PROG filesystem show >> $seqres.full 2>&1 + # Generate metadata and some minimal user data, generate 500 times # 20K extents in the data chunk and fill up metadata with inline # extents. @@ -220,8 +232,10 @@ btrfs_replace_test() if [ "${with_cancel}Q" = "cancelQ" ]; then # background the replace operation (no '-B' option given) + echo "$BTRFS_UTIL_PROG replace start -f $replace_options $source_dev $target_dev $SCRATCH_MNT" >> $seqres.full $BTRFS_UTIL_PROG replace start -f $replace_options $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" sleep 1 + echo "$BTRFS_UTIL_PROG replace cancel $SCRATCH_MNT" >> $seqres.full $BTRFS_UTIL_PROG replace cancel $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace cancel failed" # 'replace status' waits for the replace operation to finish @@ -236,6 +250,7 @@ btrfs_replace_test() # a sync in the middle of the replace operation. (sleep 1; sync) > /dev/null 2>&1 & fi + echo "$BTRFS_UTIL_PROG replace start -Bf $replace_options $source_dev $target_dev $SCRATCH_MNT" >> $seqres.full $BTRFS_UTIL_PROG replace start -Bf $replace_options $source_dev $target_dev $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "btrfs replace start failed" $BTRFS_UTIL_PROG replace status $SCRATCH_MNT > $tmp.tmp 2>&1 @@ -267,9 +282,15 @@ btrfs_replace_test() _scratch_unmount > /dev/null 2>&1 if [ "${with_cancel}Q" != "cancelQ" ]; then # after the replace operation, use the target_dev for everything + echo "$BTRFS_UTIL_PROG filesystem show -d (2)" >> $seqres.full + $BTRFS_UTIL_PROG filesystem show -d >> $seqres.full 2>&1 + echo "$BTRFS_UTIL_PROG filesystem show (3)" >> $seqres.full + $BTRFS_UTIL_PROG filesystem show >> $seqres.full 2>&1 + echo "_check_btrfs_filesystem $target_dev" >> $seqres.full _check_btrfs_filesystem $target_dev _mount -t $FSTYP `_scratch_mount_options | sed "s&${SCRATCH_DEV}&${target_dev}&"` else + echo "_check_btrfs_filesystem $source_dev" >> $seqres.full _check_btrfs_filesystem $source_dev _scratch_mount fi -- 2.7.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] fstests: btrfs/011 use replace_options 2016-02-19 13:25 [PATCH 1/2] fstests: btrfs/011 use replace_options Anand Jain 2016-02-19 13:25 ` [PATCH 2/2] fstests: btrfs/011 add debug logs to seqres.full Anand Jain @ 2016-02-24 12:42 ` David Sterba 2016-02-28 23:02 ` Dave Chinner 2016-03-09 9:17 ` Anand Jain 1 sibling, 2 replies; 6+ messages in thread From: David Sterba @ 2016-02-24 12:42 UTC (permalink / raw) To: Anand Jain; +Cc: fstests, linux-btrfs On Fri, Feb 19, 2016 at 09:25:28PM +0800, Anand Jain wrote: > This patch fixes test btrfs/011 which intended to use -r option > but was never used since its associated args 'replace_options' > didn't make it to the cli. After this patch the tests fails due to extra output. I've tested several kernels (4.5 rcs), HDD and SSD so it's not caused by my testing setup. --- tests/btrfs/011.out 2013-08-29 11:58:37.000000000 +0200 +++ /root/xfstests/results//btrfs/011.out.bad 2016-02-24 12:44:45.562234906 +0100 @@ -1,3 +1,68 @@ QA output created by 011 *** test btrfs replace +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +warning devid 2 not found already +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +warning devid 2 not found already +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +warning devid 2 not found already +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root +bytenr mismatch, want=20987904, have=0 +Couldn't read chunk root *** done ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] fstests: btrfs/011 use replace_options 2016-02-24 12:42 ` [PATCH 1/2] fstests: btrfs/011 use replace_options David Sterba @ 2016-02-28 23:02 ` Dave Chinner 2016-03-09 9:17 ` Anand Jain 1 sibling, 0 replies; 6+ messages in thread From: Dave Chinner @ 2016-02-28 23:02 UTC (permalink / raw) To: dsterba, Anand Jain, fstests, linux-btrfs On Wed, Feb 24, 2016 at 01:42:08PM +0100, David Sterba wrote: > On Fri, Feb 19, 2016 at 09:25:28PM +0800, Anand Jain wrote: > > This patch fixes test btrfs/011 which intended to use -r option > > but was never used since its associated args 'replace_options' > > didn't make it to the cli. > > After this patch the tests fails due to extra output. I've tested > several kernels (4.5 rcs), HDD and SSD so it's not caused by my testing > setup. I'll use this as an opportunity to point out that nobody is reviewing most btrfs test changes. I'll commit the changes if no-one says anything about them, they look sane to me and don't cause me any problems, but that doesn't mean they will work. Mostly I'm concerned about changes to the common code and code patterns, not what the test does or whether it is even a valid test. IOWs, it is up to the developers who use xfstests to make sure the tests relevant to their areas of expertise work correctly and are valid/viable tests, not me. To avoid this sort of issue in future, please review changes promptly. Cheers, Dave. -- Dave Chinner david@fromorbit.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] fstests: btrfs/011 use replace_options 2016-02-24 12:42 ` [PATCH 1/2] fstests: btrfs/011 use replace_options David Sterba 2016-02-28 23:02 ` Dave Chinner @ 2016-03-09 9:17 ` Anand Jain 1 sibling, 0 replies; 6+ messages in thread From: Anand Jain @ 2016-03-09 9:17 UTC (permalink / raw) To: dsterba; +Cc: fstests, linux-btrfs Sorry for the late reply. More below.. On 02/24/2016 08:42 PM, David Sterba wrote: > On Fri, Feb 19, 2016 at 09:25:28PM +0800, Anand Jain wrote: >> This patch fixes test btrfs/011 which intended to use -r option >> but was never used since its associated args 'replace_options' >> didn't make it to the cli. > > After this patch the tests fails due to extra output. I've tested > several kernels (4.5 rcs), HDD and SSD so it's not caused by my testing > setup. > > --- tests/btrfs/011.out 2013-08-29 11:58:37.000000000 +0200 > +++ /root/xfstests/results//btrfs/011.out.bad 2016-02-24 12:44:45.562234906 +0100 > @@ -1,3 +1,68 @@ > QA output created by 011 > *** test btrfs replace > +bytenr mismatch, want=20987904, have=0 > +Couldn't read chunk root > +bytenr mismatch, want=20987904, have=0 > +Couldn't read chunk root :: > +bytenr mismatch, want=20987904, have=0 > +Couldn't read chunk root > *** done Those are 'btrfs fi show' errors on defunct volumes created by previous test case within btrfs/011 or outside. An example of reproducing the above error is as below.. --------------------------------------- (a clean start) # wipefs -a /dev/sd[c-i] :: (mkfs with 4 devices) # mkfs.btrfs -f -draid10 -mraid10 /dev/sdc /dev/sdd /dev/sde /dev/sdf :: # btrfs fi show Label: none uuid: 55e2335a-6439-43a9-8d42-cb14dd3bb4b5 Total devices 4 FS bytes used 112.00KiB devid 1 size 4.00GiB used 827.12MiB path /dev/sdc devid 2 size 4.00GiB used 827.12MiB path /dev/sdd devid 3 size 4.00GiB used 827.12MiB path /dev/sde devid 4 size 4.00GiB used 827.12MiB path /dev/sdf (mkfs with only 3 devices) # mkfs.btrfs -f /dev/sdc /dev/sdd /dev/sde :: # btrfs fi show warning, device 3 is missing warning, device 2 is missing warning, device 1 is missing warning devid 1 not found already warning devid 2 not found already warning devid 3 not found already bytenr mismatch, want=37847040, have=0 <---- Couldn't setup extent tree bytenr mismatch, want=37863424, have=0 Couldn't setup device tree Label: none uuid: d57df874-2603-493c-acfc-d200297c9082 Total devices 3 FS bytes used 112.00KiB devid 1 size 4.00GiB used 1.40GiB path /dev/sdc devid 2 size 4.00GiB used 417.56MiB path /dev/sdd devid 3 size 4.00GiB used 1.41GiB path /dev/sde Label: none uuid: 55e2335a-6439-43a9-8d42-cb14dd3bb4b5 Total devices 4 FS bytes used 112.00KiB devid 4 size 4.00GiB used 827.12MiB path /dev/sdf *** Some devices missing -------------------------------------------- V2 fixes this by starting with a clean set of scratch pool devices before each sub test case. So that 011.full is clean as well. I could reproduce this when I changed the number of scratch pool devices from 5 to 4. And then the above errors in 011.full can be said to be irrelevant because of a device which does not belong to scratch pool devices But, strictly speaking we need to fix 'btrfs fi show' rather. However I am not too sure why/how those warnings/errors are useful. Thanks, Anand ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-09 9:53 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-02-19 13:25 [PATCH 1/2] fstests: btrfs/011 use replace_options Anand Jain 2016-02-19 13:25 ` [PATCH 2/2] fstests: btrfs/011 add debug logs to seqres.full Anand Jain 2016-03-09 9:53 ` [PATCH v2 " Anand Jain 2016-02-24 12:42 ` [PATCH 1/2] fstests: btrfs/011 use replace_options David Sterba 2016-02-28 23:02 ` Dave Chinner 2016-03-09 9:17 ` Anand Jain
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).