Situation is an ext2 filesystem created with
mke2fs -b 4096 -Rstride=16 /dev/md0
on a RAID5 block device (using Ingo Molnar's
Running quotacheck on that filesystem fills in all
"amount used" fields with complete garbage: even
non-existent uids end up with huge random numbers in there.
Recompiling quotacheck from source without -DEXT2_DIRECT
set makes quotacheck work OK.
Presumably the "fast and direct" way using libext2fs fails
for filesystems which don't use the default settings
(either the 4k blocksize or the non-default stride, I would
guess, since the underlying RAID block device shouldn't
affect the fs structure). Either quotacheck has a bug in the
way that it uses libext2fs or libext2fs has a bug with
non-default fs options.
The workaround of turning off -DEXT2_DIRECT is OK for now
(since the number of files hasn't yet grown enough to make
the slow-but-sure file tree walk take too long). However,
there are a couple of 40GB filesystems involved so a proper
solution would be nice before they do fill up.
If the underlying bug can't be stomped easily then a
command line option to choose between direct/non-direct
would be OK (instead of it being a compile-time option).
this works fine in newer versions of the quota and kernel.