diff options
-rw-r--r-- | fs/btrfs/qgroup.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 92e2c9f15951..c8ca5483226e 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c | |||
@@ -2406,7 +2406,6 @@ static int qgroup_reserve(struct btrfs_root *root, u64 num_bytes, bool enforce, | |||
2406 | struct btrfs_fs_info *fs_info = root->fs_info; | 2406 | struct btrfs_fs_info *fs_info = root->fs_info; |
2407 | u64 ref_root = root->root_key.objectid; | 2407 | u64 ref_root = root->root_key.objectid; |
2408 | int ret = 0; | 2408 | int ret = 0; |
2409 | int retried = 0; | ||
2410 | struct ulist_node *unode; | 2409 | struct ulist_node *unode; |
2411 | struct ulist_iterator uiter; | 2410 | struct ulist_iterator uiter; |
2412 | 2411 | ||
@@ -2420,7 +2419,6 @@ static int qgroup_reserve(struct btrfs_root *root, u64 num_bytes, bool enforce, | |||
2420 | capable(CAP_SYS_RESOURCE)) | 2419 | capable(CAP_SYS_RESOURCE)) |
2421 | enforce = false; | 2420 | enforce = false; |
2422 | 2421 | ||
2423 | retry: | ||
2424 | spin_lock(&fs_info->qgroup_lock); | 2422 | spin_lock(&fs_info->qgroup_lock); |
2425 | quota_root = fs_info->quota_root; | 2423 | quota_root = fs_info->quota_root; |
2426 | if (!quota_root) | 2424 | if (!quota_root) |
@@ -2447,27 +2445,6 @@ retry: | |||
2447 | qg = unode_aux_to_qgroup(unode); | 2445 | qg = unode_aux_to_qgroup(unode); |
2448 | 2446 | ||
2449 | if (enforce && !qgroup_check_limits(qg, num_bytes)) { | 2447 | if (enforce && !qgroup_check_limits(qg, num_bytes)) { |
2450 | /* | ||
2451 | * Commit the tree and retry, since we may have | ||
2452 | * deletions which would free up space. | ||
2453 | */ | ||
2454 | if (!retried && qgroup_rsv_total(qg) > 0) { | ||
2455 | struct btrfs_trans_handle *trans; | ||
2456 | |||
2457 | spin_unlock(&fs_info->qgroup_lock); | ||
2458 | ret = btrfs_start_delalloc_inodes(root, 0); | ||
2459 | if (ret) | ||
2460 | return ret; | ||
2461 | btrfs_wait_ordered_extents(root, U64_MAX, 0, (u64)-1); | ||
2462 | trans = btrfs_join_transaction(root); | ||
2463 | if (IS_ERR(trans)) | ||
2464 | return PTR_ERR(trans); | ||
2465 | ret = btrfs_commit_transaction(trans); | ||
2466 | if (ret) | ||
2467 | return ret; | ||
2468 | retried++; | ||
2469 | goto retry; | ||
2470 | } | ||
2471 | ret = -EDQUOT; | 2448 | ret = -EDQUOT; |
2472 | goto out; | 2449 | goto out; |
2473 | } | 2450 | } |