diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/qgroup.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index da8458357b57..9d49c586995a 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c | |||
@@ -1493,10 +1493,14 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans, | |||
1493 | { | 1493 | { |
1494 | struct btrfs_root *quota_root = fs_info->quota_root; | 1494 | struct btrfs_root *quota_root = fs_info->quota_root; |
1495 | int ret = 0; | 1495 | int ret = 0; |
1496 | int start_rescan_worker = 0; | ||
1496 | 1497 | ||
1497 | if (!quota_root) | 1498 | if (!quota_root) |
1498 | goto out; | 1499 | goto out; |
1499 | 1500 | ||
1501 | if (!fs_info->quota_enabled && fs_info->pending_quota_state) | ||
1502 | start_rescan_worker = 1; | ||
1503 | |||
1500 | fs_info->quota_enabled = fs_info->pending_quota_state; | 1504 | fs_info->quota_enabled = fs_info->pending_quota_state; |
1501 | 1505 | ||
1502 | spin_lock(&fs_info->qgroup_lock); | 1506 | spin_lock(&fs_info->qgroup_lock); |
@@ -1522,6 +1526,13 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans, | |||
1522 | if (ret) | 1526 | if (ret) |
1523 | fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; | 1527 | fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; |
1524 | 1528 | ||
1529 | if (!ret && start_rescan_worker) { | ||
1530 | ret = btrfs_qgroup_rescan(fs_info); | ||
1531 | if (ret) | ||
1532 | pr_err("btrfs: start rescan quota failed: %d\n", ret); | ||
1533 | ret = 0; | ||
1534 | } | ||
1535 | |||
1525 | out: | 1536 | out: |
1526 | 1537 | ||
1527 | return ret; | 1538 | return ret; |