diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2016-04-18 10:27:07 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-05-02 14:42:28 +0200 |
commit | f172bd2b8db3b078f5fb515a772b7e59fea43c8f (patch) | |
tree | ed8fc1aff2092760f2b3dfd3b517e03a1cefa3cd /cmds-check.c | |
parent | b652aeeb382de8bb1a00888f1a1ec27a2a1056b5 (diff) |
btrfs-progs: Fix return value bug of qgroups check
Before this patch, although btrfsck will check qgroups if quota is
enabled, it always return 0 even qgroup numbers are corrupted.
Fix it by allowing return value from report_qgroups function (formally
defined as print_qgroup_difference).
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r-- | cmds-check.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmds-check.c b/cmds-check.c index ded193e3..127ac977 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -9671,7 +9671,7 @@ int cmd_check(int argc, char **argv) uuidbuf); ret = qgroup_verify_all(info); if (ret == 0) - print_qgroup_report(1); + ret = report_qgroups(1); goto close_out; } if (subvolid) { @@ -9832,7 +9832,11 @@ int cmd_check(int argc, char **argv) ret = 1; } out: - print_qgroup_report(0); + /* Don't override original ret */ + if (ret) + report_qgroups(0); + else + ret = report_qgroups(0); if (found_old_backref) { /* * there was a disk format change when mixed * backref was in testing tree. The old format |