btrfs-progs: add quota group verify code
authorMark Fasheh <mfasheh@suse.de>
Wed, 7 May 2014 20:07:17 +0000 (13:07 -0700)
committerDavid Sterba <dsterba@suse.cz>
Fri, 22 Aug 2014 12:39:33 +0000 (14:39 +0200)
commit96ec888aad41969d728ba62c1778d6e8ebe6bd4e
tree413ea722f864ba14714ad47a57e479e29ce6d848
parent2ab405af95d43972b57c7806981220a6949df643
btrfs-progs: add quota group verify code

This patch adds functionality (in qgroup-verify.c) to compute bytecounts in
subvolume quota groups. The original groups are read in and stored in memory
so that after we compute our own bytecounts, we can compare them with those
on disk. A print function is provided to do this comparison and show the
results on the console.

A 'qgroup check' pass is added to btrfsck. If any subvolume quota groups
differ from what we compute, the differences for them are printed.  We also
provide an option '--qgroup-report' which will run only the quota check code
and print a report on all quota groups.  Other than making it possible to
verify that our qgroup changes work correctly, this mode can also be used in
xfstests for automated checking after qgroup tests.

This patch does not address the following:
- compressed counts are identical to non compressed, because kernel doesn't
  make the distinction yet.  Adding the code to verify compressed counts
  shouldn't be hard at all though once kernel can do this.
- It is only concerned with subvolume quota groups (like most of
  btrfs-progs).

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: David Sterba <dsterba@suse.cz>
Makefile
cmds-check.c
ctree.h
disk-io.c
print-tree.c
print-tree.h
qgroup-verify.c [new file with mode: 0644]
qgroup-verify.h [new file with mode: 0644]