Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 not proud of how long it took me to track down that one liner in
btrfs_sync_log(), but the good news is the patches I was trying to
blame for these problems were actually fine (sorry Filipe)"

* 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
btrfs: introduce tickets_id to determine whether asynchronous metadata reclaim work makes progress
btrfs: remove root_log_ctx from ctx list before btrfs_sync_log returns
btrfs: do not decrease bytes_may_use when replaying extents

+17 -8
+1
fs/btrfs/ctree.h
··· 427 427 struct list_head ro_bgs; 428 428 struct list_head priority_tickets; 429 429 struct list_head tickets; 430 + u64 tickets_id; 430 431 431 432 struct rw_semaphore groups_sem; 432 433 /* for block groups in our same type */
+15 -8
fs/btrfs/extent-tree.c
··· 4966 4966 */ 4967 4967 static void btrfs_async_reclaim_metadata_space(struct work_struct *work) 4968 4968 { 4969 - struct reserve_ticket *last_ticket = NULL; 4970 4969 struct btrfs_fs_info *fs_info; 4971 4970 struct btrfs_space_info *space_info; 4972 4971 u64 to_reclaim; 4973 4972 int flush_state; 4974 4973 int commit_cycles = 0; 4974 + u64 last_tickets_id; 4975 4975 4976 4976 fs_info = container_of(work, struct btrfs_fs_info, async_reclaim_work); 4977 4977 space_info = __find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA); ··· 4984 4984 spin_unlock(&space_info->lock); 4985 4985 return; 4986 4986 } 4987 - last_ticket = list_first_entry(&space_info->tickets, 4988 - struct reserve_ticket, list); 4987 + last_tickets_id = space_info->tickets_id; 4989 4988 spin_unlock(&space_info->lock); 4990 4989 4991 4990 flush_state = FLUSH_DELAYED_ITEMS_NR; ··· 5004 5005 space_info); 5005 5006 ticket = list_first_entry(&space_info->tickets, 5006 5007 struct reserve_ticket, list); 5007 - if (last_ticket == ticket) { 5008 + if (last_tickets_id == space_info->tickets_id) { 5008 5009 flush_state++; 5009 5010 } else { 5010 - last_ticket = ticket; 5011 + last_tickets_id = space_info->tickets_id; 5011 5012 flush_state = FLUSH_DELAYED_ITEMS_NR; 5012 5013 if (commit_cycles) 5013 5014 commit_cycles--; ··· 5383 5384 list_del_init(&ticket->list); 5384 5385 num_bytes -= ticket->bytes; 5385 5386 ticket->bytes = 0; 5387 + space_info->tickets_id++; 5386 5388 wake_up(&ticket->wait); 5387 5389 } else { 5388 5390 ticket->bytes -= num_bytes; ··· 5426 5426 num_bytes -= ticket->bytes; 5427 5427 space_info->bytes_may_use += ticket->bytes; 5428 5428 ticket->bytes = 0; 5429 + space_info->tickets_id++; 5429 5430 wake_up(&ticket->wait); 5430 5431 } else { 5431 5432 trace_btrfs_space_reservation(fs_info, "space_info", ··· 8217 8216 { 8218 8217 int ret; 8219 8218 struct btrfs_block_group_cache *block_group; 8219 + struct btrfs_space_info *space_info; 8220 8220 8221 8221 /* 8222 8222 * Mixed block groups will exclude before processing the log so we only ··· 8233 8231 if (!block_group) 8234 8232 return -EINVAL; 8235 8233 8236 - ret = btrfs_add_reserved_bytes(block_group, ins->offset, 8237 - ins->offset, 0); 8238 - BUG_ON(ret); /* logic error */ 8234 + space_info = block_group->space_info; 8235 + spin_lock(&space_info->lock); 8236 + spin_lock(&block_group->lock); 8237 + space_info->bytes_reserved += ins->offset; 8238 + block_group->reserved += ins->offset; 8239 + spin_unlock(&block_group->lock); 8240 + spin_unlock(&space_info->lock); 8241 + 8239 8242 ret = alloc_reserved_file_extent(trans, root, 0, root_objectid, 8240 8243 0, owner, offset, ins, 1); 8241 8244 btrfs_put_block_group(block_group);
+1
fs/btrfs/tree-log.c
··· 2867 2867 2868 2868 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { 2869 2869 blk_finish_plug(&plug); 2870 + list_del_init(&root_log_ctx.list); 2870 2871 mutex_unlock(&log_root_tree->log_mutex); 2871 2872 ret = root_log_ctx.log_ret; 2872 2873 goto out;