Skip to contentSkip to conversation

common: set _fs_has_crcs=0 as default in _filter_mkfs()

PATCH In review Eryu Guan 2 participants 4 messages Apr 17, 2014 – Apr 22, 2014

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH 1/3 common: set _fs_has_crcs=0 as default in _filter_mkfs()

xfsprogs without crc support won't print crc=0/crc=1, so _filter_mkfs() leaves _fs_has_crcs variable unset, and xfs/033 fails because of that.

xfs/033 4s ... - output mismatch (see /root/xfstests/results//xfs/033.out.bad)
--- tests/xfs/033.out 2014-04-16 22:31:49.818350450 -0400
+++ /root/xfstests/results//xfs/033.out.bad 2014-04-16 22:35:08.264401190 -0400 @@ -5,6 +5,7 @@
naming =VERN bsize=XXX
log =LDEV bsize=XXX blocks=XXX
realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+./tests/xfs/033: line 87: [: -eq: unary operator expected
Corrupting root inode - setting bits to 0
Wrote X.XXKb (value 0x0)
Phase 1 - find and verify superblock...

Print _fs_has_crcs=0 to stderr by default, so old xfsprogs could have this variable set too, and a latter _fs_has_crcs=1 could overwrite it if the fs does have crc support.

---
 common/filter | 1 +
 1 file changed, 1 insertion(+)
common/filter +1 -0
index a7d2aa9..05dbae6 100644
@@ -143,6 +143,7 @@ _filter_mkfs()
 	return ;;
     esac
 
+    echo "_fs_has_crcs=0" >&2
     set -
     perl -ne '
     if (/^meta-data=([\w,|\/.-]+)\s+isize=(\d+)\s+agcount=(\d+), agsize=(\d+) blks/) {
Signature · 6 lines
1.9.0

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#1 lore raw

PATCH 2/3 generic/009: fix _require_xfs_io_command

_require_xfs_io_falloc "fzero" should be a typo, it requires falloc command. Use the correct _require_xfs_io_command "fzero".

fiemap is also needed, add that too.

---
 tests/generic/009 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/generic/009 +2 -1
index b7b0b3f..1e487b4 100644
@@ -44,7 +44,8 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 
 # real QA test starts here
 _supported_os Linux
-_require_xfs_io_falloc "fzero"
+_require_xfs_io_fiemap
+_require_xfs_io_command "fzero"
 
 testfile=$TEST_DIR/009.$$
 
Signature · 6 lines
1.9.0

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#2 lore raw

PATCH 3/3 generic/009: get the correct dev name when testing ext4

In reply to Eryu Guan

If TEST_DEV is a symlink(usually a lvm), we get the wrong DEV name. Follow link and get the correct dev name.

---
 tests/generic/009 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/009 +1 -1
index 1e487b4..7675c69 100644
@@ -51,7 +51,7 @@ testfile=$TEST_DIR/009.$$
 
 # Disable extent zeroing for ext4 as that change where holes are created
 if [ "$FSTYP" = "ext4" ]; then
-	DEV=`basename $TEST_DEV`
+	DEV=`basename $(readlink -f $TEST_DEV)`
 	echo 0 >/sys/fs/ext4/$DEV/extent_max_zeroout_kb
 fi
 
Signature · 6 lines
1.9.0

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#3 lore raw

Re: [PATCH 3/3] generic/009: get the correct dev name when testing ext4

Quoted 13 lines · Eryu Guan

If TEST_DEV is a symlink(usually a lvm), we get the wrong DEV name. Follow link and get the correct dev name.

---
 tests/generic/009 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/009 +0 -0
index 1e487b4..7675c69 100644

tests/generic/009 testfile=$TEST_DIR/009.$$ · line 56

Quoted 7 lines
tests/generic/009 +1 -1
@@ -51,7 +51,7 @@ testfile=$TEST_DIR/009.$$
 
 # Disable extent zeroing for ext4 as that change where holes are created
 if [ "$FSTYP" = "ext4" ]; then
-	DEV=`basename $TEST_DEV`
+	DEV=`basename $(readlink -f $TEST_DEV)`
 	echo 0 >/sys/fs/ext4/$DEV/extent_max_zeroout_kb
 fi

We've made this mistake several times now. Can you add a function in common/rc that does this. e.g. "_real_dev()" and replace all the current 'readlink -f $DEV' calls with that function? i.e. something like:

_real_dev()

{
	local _dev=$1
	if [ -L "$_dev" ]; then
		_dev=`readlink -f $_dev`
	fi
	echo $_dev
}

_short_dev()

{
	echo `basename $(_real_dev $1)`
}

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs