From 47dbcf13f707f82fd74b1d3dc808de36785c1fa2 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Tue, 18 Feb 2014 17:16:26 +1100 Subject: [PATCH] xfs/299: users can't modify root owned files xfs/299 has failed for me for a long time. In fact, looking at my logs it has never passed on any of my test machines. IOWs, the test that was committed was fundamentally broken. The reason is that it tests project quotas before it tests user or group quotas and so creates a bunch of files that are owned by root or privileged users. It think tries to manipulate them as a user, and, unsurprisingly, it fails to do so. This then causes the test to throw an error. The reason it has always failed is the error that is thrown hardcodes a uid/gid into an error message. This uid/gid is what causes the golden output mismatch (nobody is 65534 on my machines, not 99): *** push past the hard block limit (expect EDQUOT) [ROOT] 0 0 0 00 [--------] 12 0 0 00 [--------] 0 0 0 00 [--------] [NAME] =OK= 100 500 00 [--------] 7 4 10 00 [7 days] 0 0 0 00 [--------] - URK 99: 0 is out of range! [425,500] + URK 65534: 0 is out of range! [425,500] It wasn't until I looked at the xfs/299.full file when trying to understand why the error was being thrown and whether it shoul dhave been in the golden output in the first place that I saw the real problem. That is, All the user/group quota modifications were failing because of not having permissions to write the files left behind by the quota test, and that user and group quotas were not being tested at all by the test. So, firstly $SCRATCH_MNT needs to be world writeable, and secondly each test needs to remove the files it created during the test so they don't impact on furture test iterations. This then exercises the user and group quotas appropriately, and so the golden output changes completely to reflect that changes under user quotas are actually being accounted to the correct user. Further, the error message that I originally saw errors on goes away, because everything is now accounted correctly. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- tests/xfs/299 | 6 +++ tests/xfs/299.out | 96 ++++++++++++++++++++++------------------------- 2 files changed, 50 insertions(+), 52 deletions(-) diff --git a/tests/xfs/299 b/tests/xfs/299 index e3741316..d1909743 100755 --- a/tests/xfs/299 +++ b/tests/xfs/299 @@ -193,6 +193,9 @@ _exercise() echo + # clean up our files so we don't pollute the next run + rm -f $SCRATCH_MNT/* + } _scratch_mkfs_xfs -m crc=1 2>/dev/null | _filter_mkfs 2>$tmp.mkfs @@ -200,6 +203,9 @@ cat $tmp.mkfs >>$seqres.full # keep the blocksize and data size for dd later . $tmp.mkfs +# non-root users need to be able to write to this filesystem +chmod 777 $SCRATCH_MNT + cat >$tmp.projects <