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 tag 'for-5.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
"These are fixes that were found during testing with help of error
injection, plus some other stable material.

There's a fixup to patch added to rc1 causing locking in wrong context
warnings, tests found one more deadlock scenario. The patches are
tagged for stable, two of them now in the queue but we'd like all
three released at the same time.

I'm not happy about fixes to fixes in such a fast succession during
rcs, but I hope we found all the fallouts of commit 28553fa992cb
('Btrfs: fix race between shrinking truncate and fiemap')"

* tag 'for-5.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
Btrfs: fix deadlock during fast fsync when logging prealloc extents beyond eof
Btrfs: fix btrfs_wait_ordered_range() so that it waits for all ordered extents
btrfs: fix bytes_may_use underflow in prealloc error condtition
btrfs: handle logged extent failure properly
btrfs: do not check delayed items are empty for single transaction cleanup
btrfs: reset fs_root to NULL on error in open_ctree
btrfs: destroy qgroup extent records on transaction abort

+44 -10
+2 -1
fs/btrfs/disk-io.c
··· 3200 3200 if (IS_ERR(fs_info->fs_root)) { 3201 3201 err = PTR_ERR(fs_info->fs_root); 3202 3202 btrfs_warn(fs_info, "failed to read fs tree: %d", err); 3203 + fs_info->fs_root = NULL; 3203 3204 goto fail_qgroup; 3204 3205 } 3205 3206 ··· 4277 4276 cond_resched(); 4278 4277 spin_lock(&delayed_refs->lock); 4279 4278 } 4279 + btrfs_qgroup_destroy_extent_records(trans); 4280 4280 4281 4281 spin_unlock(&delayed_refs->lock); 4282 4282 ··· 4503 4501 wake_up(&fs_info->transaction_wait); 4504 4502 4505 4503 btrfs_destroy_delayed_inodes(fs_info); 4506 - btrfs_assert_delayed_root_empty(fs_info); 4507 4504 4508 4505 btrfs_destroy_marked_extents(fs_info, &cur_trans->dirty_pages, 4509 4506 EXTENT_DIRTY);
+2
fs/btrfs/extent-tree.c
··· 4430 4430 4431 4431 ret = alloc_reserved_file_extent(trans, 0, root_objectid, 0, owner, 4432 4432 offset, ins, 1); 4433 + if (ret) 4434 + btrfs_pin_extent(fs_info, ins->objectid, ins->offset, 1); 4433 4435 btrfs_put_block_group(block_group); 4434 4436 return ret; 4435 4437 }
+18 -8
fs/btrfs/inode.c
··· 4103 4103 return -ENOMEM; 4104 4104 path->reada = READA_BACK; 4105 4105 4106 - lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, (u64)-1, 4107 - &cached_state); 4106 + if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) 4107 + lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, (u64)-1, 4108 + &cached_state); 4108 4109 4109 4110 /* 4110 4111 * We want to drop from the next block forward in case this new size is ··· 4369 4368 if (!ret && last_size > new_size) 4370 4369 last_size = new_size; 4371 4370 btrfs_ordered_update_i_size(inode, last_size, NULL); 4371 + unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, 4372 + (u64)-1, &cached_state); 4372 4373 } 4373 - 4374 - unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, (u64)-1, 4375 - &cached_state); 4376 4374 4377 4375 btrfs_free_path(path); 4378 4376 return ret; ··· 9824 9824 struct btrfs_root *root = BTRFS_I(inode)->root; 9825 9825 struct btrfs_key ins; 9826 9826 u64 cur_offset = start; 9827 + u64 clear_offset = start; 9827 9828 u64 i_size; 9828 9829 u64 cur_bytes; 9829 9830 u64 last_alloc = (u64)-1; ··· 9859 9858 btrfs_end_transaction(trans); 9860 9859 break; 9861 9860 } 9861 + 9862 + /* 9863 + * We've reserved this space, and thus converted it from 9864 + * ->bytes_may_use to ->bytes_reserved. Any error that happens 9865 + * from here on out we will only need to clear our reservation 9866 + * for the remaining unreserved area, so advance our 9867 + * clear_offset by our extent size. 9868 + */ 9869 + clear_offset += ins.offset; 9862 9870 btrfs_dec_block_group_reservations(fs_info, ins.objectid); 9863 9871 9864 9872 last_alloc = ins.offset; ··· 9947 9937 if (own_trans) 9948 9938 btrfs_end_transaction(trans); 9949 9939 } 9950 - if (cur_offset < end) 9951 - btrfs_free_reserved_data_space(inode, NULL, cur_offset, 9952 - end - cur_offset + 1); 9940 + if (clear_offset < end) 9941 + btrfs_free_reserved_data_space(inode, NULL, clear_offset, 9942 + end - clear_offset + 1); 9953 9943 return ret; 9954 9944 } 9955 9945
+6 -1
fs/btrfs/ordered-data.c
··· 679 679 } 680 680 btrfs_start_ordered_extent(inode, ordered, 1); 681 681 end = ordered->file_offset; 682 + /* 683 + * If the ordered extent had an error save the error but don't 684 + * exit without waiting first for all other ordered extents in 685 + * the range to complete. 686 + */ 682 687 if (test_bit(BTRFS_ORDERED_IOERR, &ordered->flags)) 683 688 ret = -EIO; 684 689 btrfs_put_ordered_extent(ordered); 685 - if (ret || end == 0 || end == start) 690 + if (end == 0 || end == start) 686 691 break; 687 692 end--; 688 693 }
+13
fs/btrfs/qgroup.c
··· 4002 4002 } 4003 4003 return ret; 4004 4004 } 4005 + 4006 + void btrfs_qgroup_destroy_extent_records(struct btrfs_transaction *trans) 4007 + { 4008 + struct btrfs_qgroup_extent_record *entry; 4009 + struct btrfs_qgroup_extent_record *next; 4010 + struct rb_root *root; 4011 + 4012 + root = &trans->delayed_refs.dirty_extent_root; 4013 + rbtree_postorder_for_each_entry_safe(entry, next, root, node) { 4014 + ulist_free(entry->old_roots); 4015 + kfree(entry); 4016 + } 4017 + }
+1
fs/btrfs/qgroup.h
··· 414 414 u64 last_snapshot); 415 415 int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans, 416 416 struct btrfs_root *root, struct extent_buffer *eb); 417 + void btrfs_qgroup_destroy_extent_records(struct btrfs_transaction *trans); 417 418 418 419 #endif
+2
fs/btrfs/transaction.c
··· 121 121 BUG_ON(!list_empty(&transaction->list)); 122 122 WARN_ON(!RB_EMPTY_ROOT( 123 123 &transaction->delayed_refs.href_root.rb_root)); 124 + WARN_ON(!RB_EMPTY_ROOT( 125 + &transaction->delayed_refs.dirty_extent_root)); 124 126 if (transaction->delayed_refs.pending_csums) 125 127 btrfs_err(transaction->fs_info, 126 128 "pending csums is %llu",