Bug 616334 - [ext4] repquota used blocks count increased after running fsx
[ext4] repquota used blocks count increased after running fsx
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
6.0
x86_64 Linux
low Severity medium
: rc
: ---
Assigned To: Eric Sandeen
Petr Beňas
: RHELNAK
Depends On:
Blocks: 616338
  Show dependency treegraph
 
Reported: 2010-07-20 03:58 EDT by Petr Beňas
Modified: 2015-01-04 17:59 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-07-29 04:17:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Beňas 2010-07-20 03:58:32 EDT
Description of problem:
xfstest 231 failing on ext4

Version-Release number of selected component (if applicable):
2.6.32-44.el6.x86_64

How reproducible:
always

Steps to Reproduce:
install dependencies:
autoconf       
e2fsprogs-devel
gcc-c++        
gdbm-devel     
git            
indent         
libacl-devel   
libaio-devel   
libattr-devel  
libtool        
libuuid-devel  
rpm-build      
xfsprogs-devel 

# useradd fsgqa
# git clone git://oss.sgi.com/xfs/cmds/xfstests
[root@hp-dl360g6-01 ~]# truncate --size 1G file
[root@hp-dl360g6-01 ~]# mkfs.ext4 -F file
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376

Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@hp-dl360g6-01 ~]# losetup /dev/loop0 file 
[root@hp-dl360g6-01 ~]# mkdir /mnt/test
[root@hp-dl360g6-01 ~]# mount /dev/loop0 /mnt/test
[root@hp-dl360g6-01 ~]# export TEST_DEV=/dev/loop0
[root@hp-dl360g6-01 ~]# export TEST_DIR=/mnt/test/
[root@hp-dl360g6-01 ~]# truncate --size 2G scratch
[root@hp-dl360g6-01 ~]# mkfs.ext4 -F scratch 
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
131072 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912

Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@hp-dl360g6-01 ~]# losetup /dev/loop1 scratch 
[root@hp-dl360g6-01 ~]# mkdir /mnt/scratch
[root@hp-dl360g6-01 ~]# mount /dev/loop1 /mnt/scratch/
[root@hp-dl360g6-01 ~]# export SCRATCH_DEV=/dev/loop1
[root@hp-dl360g6-01 ~]# export SCRATCH_DEV=/dev/loop1
[root@hp-dl360g6-01 ~]# cd xfstests/
[root@hp-dl360g6-01 xfstests]# make
[root@hp-dl360g6-01 xfstests]# ./check 231

Actual results:
FSTYP         -- ext4
PLATFORM      -- Linux/x86_64 hp-dl360g6-01 2.6.32-44.el6.x86_64
MKFS_OPTIONS  -- /dev/loop1
MOUNT_OPTIONS -- -o acl,user_xattr -o context=system_u:object_r:nfs_t:s0 /dev/loop1 /mnt/scratch

231      [failed, exit status 1] - output mismatch (see 231.out.bad)
--- 231.out     2010-07-15 03:21:07.958051524 -0400
+++ 231.out.bad 2010-07-15 03:34:10.861480576 -0400
@@ -1,10 +1,11 @@
 QA output created by 231
 === FSX Standard Mode, Memory Mapping, 1 Tasks ===
 All operations completed A-OK!
-=== FSX Standard Mode, Memory Mapping, 4 Tasks ===
-All operations completed A-OK!
-All operations completed A-OK!
-All operations completed A-OK!
-All operations completed A-OK!
-=== FSX Standard Mode, Memory Mapping, 1 Tasks ===
-All operations completed A-OK!
+6c6
+< fsgqa     --     760       0       0              3     0     0       
+---
+> fsgqa     --     764       0       0              3     0     0       
+14c14
+< fsgqa     --     760       0       0              3     0     0       
+---
+> fsgqa     --     764       0       0              3     0     0       
Ran: 231
Failures: 231
Failed 1 of 1 tests

Expected results:
Passes the test

Additional info:
this is the function where fail is detected:
check_usage()
{
	quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
	repquota -u -g $SCRATCH_MNT  | grep -v "^root" | filter_scratch \
		>$tmp.orig
	quotacheck -u -g $SCRATCH_MNT 2>/dev/null
	repquota -u -g $SCRATCH_MNT  | grep -v "^root" | filter_scratch \
		>$tmp.checked
	quotaon -u -g $SCRATCH_MNT 2>/dev/null
	diff $tmp.orig $tmp.checked
}
FSX_FILE_SIZE=64000000
FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -N 20000"
and this is the _fsx function which needs to be called before check_usage
function, otherwise the fail does not happen
_fsx()
{
	tasks=$1
	echo "=== FSX Standard Mode, Memory Mapping, $tasks Tasks ==="
	for (( i = 1; i <= $tasks; i++ )); do
		SEED=$RANDOM
		echo "ltp/fsx $FSX_ARGS -S $SEED $SCRATCH_MNT/fsx_file$i" >>$seq.full
		su $qa_user -c "ltp/fsx $FSX_ARGS -S $SEED \
			$SCRATCH_MNT/fsx_file$i" >$tmp.output$i 2>&1 &
	done

	for (( i = 1; i <= $tasks; i++ )); do
		if ! wait %$i; then
			cat $tmp.output$i | tee -a $seq.full
			wait
			return 1
		fi
		$XFS_IO_PROG -F -c 'fsync' $SCRATCH_MNT/fsx_file$i
		cat $tmp.output$i | tee -a $seq.full
	done
	return 0
}
see xfstest 231 for more details
Comment 2 RHEL Product and Program Management 2010-07-20 04:17:34 EDT
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **
Comment 3 Eric Sandeen 2010-07-26 17:38:50 EDT
It's not that fsx changed the quota output; rather, quotacheck seems to have increased the used blocks by 4.

I don't know if repquota/quotacheck do any syncing, but it seems at least possible that there is delalloc IO that happens in between the two repquotas.

I've not been able to reproduce this one either, but maybe you can try adding a "sync" call as the first line in check_usage, see if that changes anything?
Comment 5 Eric Sandeen 2010-07-27 11:09:01 EDT
I think this is just a test problem.

Could you please update your xfstests git tree to the latest, and re-run the test?

http://git.kernel.org/?p=fs/xfs/xfstests-dev.git;a=commitdiff;h=176002236e4902dc66e20a2bbba8609731733e8a

should have fixed this problem.
Comment 6 Petr Beňas 2010-07-29 04:09:09 EDT
(In reply to comment #5)
> I think this is just a test problem.
> 
> Could you please update your xfstests git tree to the latest, and re-run the
> test?
> 
> http://git.kernel.org/?p=fs/xfs/xfstests-dev.git;a=commitdiff;h=176002236e4902dc66e20a2bbba8609731733e8a
> 
> should have fixed this problem.    

Verified. xfstest 231 passes with the configuration from bug description

[root@dell-pesc1420-01 xfstests]# ./check 231
FSTYP         -- ext4
PLATFORM      -- Linux/x86_64 dell-pesc1420-01 2.6.32-44.el6.x86_64
MKFS_OPTIONS  -- /dev/loop1
MOUNT_OPTIONS -- -o acl,user_xattr -o context=system_u:object_r:nfs_t:s0 /dev/loop1 /mnt/scratch

231
Ran: 231
Passed all 1 tests
Comment 7 Petr Beňas 2010-07-29 04:17:34 EDT
This is not ext4 bug. Moving to closed notabug.

Note You need to log in before you can comment on or make changes to this bug.