aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-02-27 03:24:24 -0500
committerChris Mason <clm@fb.com>2015-04-13 10:52:55 -0400
commit3393168d22fd5f1be5b5429a818c10f642e88ae3 (patch)
tree58f98954833569661097337c861ce83324dc63e7 /fs
parente09fe2d2119800e6060f9b8ba71e072a0eb0fa4d (diff)
btrfs: qgroup: Fix dead judgement on qgroup_rescan_leaf() return value.
Old qgroup_rescan_leaf() comment indicates ret == 2 as complete and cleared INCONSISTENT flag. This is not true since it will never return 2, and inside it no codes will clear INCONSISTENT flag. The flag clearance is done in btrfs_qgroup_rescan_work(). This caused the bug that INCONSISTENT flag is never cleared. So change the comment and fix the dead judgment. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/qgroup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 4fb9610beec7..44192370310b 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2560,7 +2560,7 @@ void assert_qgroups_uptodate(struct btrfs_trans_handle *trans)
2560 2560
2561/* 2561/*
2562 * returns < 0 on error, 0 when more leafs are to be scanned. 2562 * returns < 0 on error, 0 when more leafs are to be scanned.
2563 * returns 1 when done, 2 when done and FLAG_INCONSISTENT was cleared. 2563 * returns 1 when done.
2564 */ 2564 */
2565static int 2565static int
2566qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path, 2566qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
@@ -2707,7 +2707,7 @@ out:
2707 mutex_lock(&fs_info->qgroup_rescan_lock); 2707 mutex_lock(&fs_info->qgroup_rescan_lock);
2708 fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_RESCAN; 2708 fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_RESCAN;
2709 2709
2710 if (err == 2 && 2710 if (err > 0 &&
2711 fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT) { 2711 fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT) {
2712 fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; 2712 fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT;
2713 } else if (err < 0) { 2713 } else if (err < 0) {
@@ -2717,7 +2717,7 @@ out:
2717 2717
2718 if (err >= 0) { 2718 if (err >= 0) {
2719 btrfs_info(fs_info, "qgroup scan completed%s", 2719 btrfs_info(fs_info, "qgroup scan completed%s",
2720 err == 2 ? " (inconsistency flag cleared)" : ""); 2720 err > 0 ? " (inconsistency flag cleared)" : "");
2721 } else { 2721 } else {
2722 btrfs_err(fs_info, "qgroup scan failed with %d", err); 2722 btrfs_err(fs_info, "qgroup scan failed with %d", err);
2723 } 2723 }