e2fsck: fix quota accounting to use cluster units

The quota accounting code in e2fsck's pass 1 and pass 3 uses block units
rather than cluster units when recording the allocated space consumed by
files and directories.  In pass 1, this causes a large undercount of
actual quota results and test failures for xfstests generic/383, /384,
/385, and /386 on bigalloc file systems.  In pass 3, this results in
quota accounting errors when the lost+found directory is either extended
or recreated on a bigalloc file system.

Use clusters rather than blocks when accounting for allocated space,
and correct a related header comment in the quota code.

Note that pass 1b also contains call sites for quota_data_sub() that
also need to be addressed.  However, it appears that more than just
unit conversion may be needed, so that will be left to a future patch.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
3 files changed