diff options
| -rw-r--r-- | fs/btrfs/extent-tree.c | 10 | ||||
| -rw-r--r-- | fs/btrfs/relocation.c | 8 | ||||
| -rw-r--r-- | fs/btrfs/send.c | 8 |
3 files changed, 15 insertions, 11 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 0450dc410533..8c8a4d1e02b9 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -4901,11 +4901,6 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_root *root, | |||
| 4901 | u64 expected; | 4901 | u64 expected; |
| 4902 | u64 to_reclaim = 0; | 4902 | u64 to_reclaim = 0; |
| 4903 | 4903 | ||
| 4904 | to_reclaim = min_t(u64, num_online_cpus() * SZ_1M, SZ_16M); | ||
| 4905 | if (can_overcommit(root, space_info, to_reclaim, | ||
| 4906 | BTRFS_RESERVE_FLUSH_ALL)) | ||
| 4907 | return 0; | ||
| 4908 | |||
| 4909 | list_for_each_entry(ticket, &space_info->tickets, list) | 4904 | list_for_each_entry(ticket, &space_info->tickets, list) |
| 4910 | to_reclaim += ticket->bytes; | 4905 | to_reclaim += ticket->bytes; |
| 4911 | list_for_each_entry(ticket, &space_info->priority_tickets, list) | 4906 | list_for_each_entry(ticket, &space_info->priority_tickets, list) |
| @@ -4913,6 +4908,11 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_root *root, | |||
| 4913 | if (to_reclaim) | 4908 | if (to_reclaim) |
| 4914 | return to_reclaim; | 4909 | return to_reclaim; |
| 4915 | 4910 | ||
| 4911 | to_reclaim = min_t(u64, num_online_cpus() * SZ_1M, SZ_16M); | ||
| 4912 | if (can_overcommit(root, space_info, to_reclaim, | ||
| 4913 | BTRFS_RESERVE_FLUSH_ALL)) | ||
| 4914 | return 0; | ||
| 4915 | |||
| 4916 | used = space_info->bytes_used + space_info->bytes_reserved + | 4916 | used = space_info->bytes_used + space_info->bytes_reserved + |
| 4917 | space_info->bytes_pinned + space_info->bytes_readonly + | 4917 | space_info->bytes_pinned + space_info->bytes_readonly + |
| 4918 | space_info->bytes_may_use; | 4918 | space_info->bytes_may_use; |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 8a2c2a07987b..c0c13dc6fe12 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
| @@ -4200,9 +4200,11 @@ restart: | |||
| 4200 | err = PTR_ERR(trans); | 4200 | err = PTR_ERR(trans); |
| 4201 | goto out_free; | 4201 | goto out_free; |
| 4202 | } | 4202 | } |
| 4203 | err = qgroup_fix_relocated_data_extents(trans, rc); | 4203 | ret = qgroup_fix_relocated_data_extents(trans, rc); |
| 4204 | if (err < 0) { | 4204 | if (ret < 0) { |
| 4205 | btrfs_abort_transaction(trans, err); | 4205 | btrfs_abort_transaction(trans, ret); |
| 4206 | if (!err) | ||
| 4207 | err = ret; | ||
| 4206 | goto out_free; | 4208 | goto out_free; |
| 4207 | } | 4209 | } |
| 4208 | btrfs_commit_transaction(trans, rc->extent_root); | 4210 | btrfs_commit_transaction(trans, rc->extent_root); |
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index efe129fe2678..a87675ffd02b 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
| @@ -4268,10 +4268,12 @@ static int process_all_refs(struct send_ctx *sctx, | |||
| 4268 | } | 4268 | } |
| 4269 | btrfs_release_path(path); | 4269 | btrfs_release_path(path); |
| 4270 | 4270 | ||
| 4271 | /* | ||
| 4272 | * We don't actually care about pending_move as we are simply | ||
| 4273 | * re-creating this inode and will be rename'ing it into place once we | ||
| 4274 | * rename the parent directory. | ||
| 4275 | */ | ||
| 4271 | ret = process_recorded_refs(sctx, &pending_move); | 4276 | ret = process_recorded_refs(sctx, &pending_move); |
| 4272 | /* Only applicable to an incremental send. */ | ||
| 4273 | ASSERT(pending_move == 0); | ||
| 4274 | |||
| 4275 | out: | 4277 | out: |
| 4276 | btrfs_free_path(path); | 4278 | btrfs_free_path(path); |
| 4277 | return ret; | 4279 | return ret; |
