Subject: testfs.sh-0.20 patches
From: Corey Wright <undefined@pobox.com>
Date: Wed, 19 Aug 2009 13:48:33 -0500
Wed, 19 Aug 2009 13:48:33 -0500
attached are two patches to testfs.sh-0.20 based on an irc conversation
(http://irc.13thfloor.at/LOG/2009-08/LOG_2009-08-19.txt) and experience
with a stable kernel (2.6.27.31), a recent/stable linux-vserver patch
(vs2.3.0.36.6), and several util-vserver versions (0.30.216-pre2841,
0.30.216-pre2772, & 0.30.214; in case that makes a difference) on two
different platforms (debian lenny amd64 & ubuntu hardy i386).

detailed explanations are at the top of each patch file.

corey
-- 
undefined@pobox.com


change pattern passed to do_xattr_barrier (.^^ -> ..^) as context 1 has access
to the barrier (where it did not previously)

--- /root/bin/testfs.sh-0.20	2008-09-04 08:50:31.000000000 -0500
+++ /root/bin/testfs.sh-0.20a	2009-08-19 10:02:33.000000000 -0500
@@ -495,7 +495,7 @@ function do_test () {
 	eexec 103	0 "do_xattr_verify $MNT showattr $dpath $attr_B"
 	eexec 104	0 "do_xattr_verify $MNT lsattr $dpath $lsattr_B"
 	eexec 105	0 "go_xid 2 chattr =i $dpath"
-	eexec 106	0 "do_xattr_barrier $MNT $dpath .^^"
+	eexec 106	0 "do_xattr_barrier $MNT $dpath ..^"
 	eexec 108	0 "setattr --~barrier $dpath"
 	eexec 109	0 "do_xattr_verify $MNT showattr $dpath $attr_b"
 	eeval		  "rmdir $dpath"


change expected result to fail (0 -> 1) as trying to execute chattr on a
barrier from context 2 is expected to fail.

this test is problematic because some versions of chattr (e2fsprogs
1.40.8-2ubuntu2 in ubuntu hardy) return success even though the barrier is not
visible to chattr (ie "chattr: No such file or directory while trying to stat
<barrier>").  so even though chattr failed to act on the barrier (as it could
not see it), it still reports success (ie exit code 0).

todo/suggestion: first stat the barrier and only try to chattr the barrier if
stat is successful (because if stat fails, then chattr will definitely fail).

--- /root/bin/testfs.sh-0.20a	2009-08-19 10:02:33.000000000 -0500
+++ /root/bin/testfs.sh-0.20b	2009-08-19 12:04:09.000000000 -0500
@@ -494,7 +494,7 @@ function do_test () {
 	eexec 102	0 "setattr --barrier $dpath"
 	eexec 103	0 "do_xattr_verify $MNT showattr $dpath $attr_B"
 	eexec 104	0 "do_xattr_verify $MNT lsattr $dpath $lsattr_B"
-	eexec 105	0 "go_xid 2 chattr =i $dpath"
+	eexec 105	1 "go_xid 2 chattr =i $dpath"
 	eexec 106	0 "do_xattr_barrier $MNT $dpath ..^"
 	eexec 108	0 "setattr --~barrier $dpath"
 	eexec 109	0 "do_xattr_verify $MNT showattr $dpath $attr_b"