Merge branch 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
"I'm still prepping a set of fixes for btrfs fsync, just nailing down a
hard to trigger memory corruption. For now, these are tested and ready."

* 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
btrfs: fix one bug that process may endlessly wait for ticket in wait_reserve_ticket()
Btrfs: fix endless loop in balancing block groups
Btrfs: kill invalid ASSERT() in process_all_refs()

Changed files
+15 -11
fs
+5 -5
fs/btrfs/extent-tree.c
··· 4901 4901 u64 expected; 4902 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 4904 list_for_each_entry(ticket, &space_info->tickets, list) 4910 4905 to_reclaim += ticket->bytes; 4911 4906 list_for_each_entry(ticket, &space_info->priority_tickets, list) 4912 4907 to_reclaim += ticket->bytes; 4913 4908 if (to_reclaim) 4914 4909 return to_reclaim; 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 4915 4916 4916 used = space_info->bytes_used + space_info->bytes_reserved + 4917 4917 space_info->bytes_pinned + space_info->bytes_readonly +
+5 -3
fs/btrfs/relocation.c
··· 4200 4200 err = PTR_ERR(trans); 4201 4201 goto out_free; 4202 4202 } 4203 - err = qgroup_fix_relocated_data_extents(trans, rc); 4204 - if (err < 0) { 4205 - btrfs_abort_transaction(trans, err); 4203 + ret = qgroup_fix_relocated_data_extents(trans, rc); 4204 + if (ret < 0) { 4205 + btrfs_abort_transaction(trans, ret); 4206 + if (!err) 4207 + err = ret; 4206 4208 goto out_free; 4207 4209 } 4208 4210 btrfs_commit_transaction(trans, rc->extent_root);
+5 -3
fs/btrfs/send.c
··· 4268 4268 } 4269 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 4276 ret = process_recorded_refs(sctx, &pending_move); 4272 - /* Only applicable to an incremental send. */ 4273 - ASSERT(pending_move == 0); 4274 - 4275 4277 out: 4276 4278 btrfs_free_path(path); 4277 4279 return ret;