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

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

Pull btrfs fixes from Chris Mason:
"Filipe fixed up a hard to trigger ENOSPC regression from our merge
window pull, and we have a few other smaller fixes"

* 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: fix quick exhaustion of the system array in the superblock
btrfs: its btrfs_err() instead of btrfs_error()
btrfs: Avoid NULL pointer dereference of free_extent_buffer when read_tree_block() fail
btrfs: Fix lockdep warning of btrfs_run_delayed_iputs()

+23 -3
+1 -1
fs/btrfs/dev-replace.c
··· 378 378 379 379 ret = btrfs_kobj_add_device(tgt_device->fs_devices, tgt_device); 380 380 if (ret) 381 - btrfs_error(root->fs_info, ret, "kobj add dev failed"); 381 + btrfs_err(root->fs_info, "kobj add dev failed %d\n", ret); 382 382 383 383 printk_in_rcu(KERN_INFO 384 384 "BTRFS: dev_replace from %s (devid %llu) to %s started\n",
+2 -1
fs/btrfs/disk-io.c
··· 2842 2842 !extent_buffer_uptodate(chunk_root->node)) { 2843 2843 printk(KERN_ERR "BTRFS: failed to read chunk root on %s\n", 2844 2844 sb->s_id); 2845 + chunk_root->node = NULL; 2845 2846 goto fail_tree_roots; 2846 2847 } 2847 2848 btrfs_set_root_node(&chunk_root->root_item, chunk_root->node); ··· 2880 2879 !extent_buffer_uptodate(tree_root->node)) { 2881 2880 printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n", 2882 2881 sb->s_id); 2883 - 2882 + tree_root->node = NULL; 2884 2883 goto recovery_tree_root; 2885 2884 } 2886 2885
+18
fs/btrfs/extent-tree.c
··· 4227 4227 space_info->chunk_alloc = 0; 4228 4228 spin_unlock(&space_info->lock); 4229 4229 mutex_unlock(&fs_info->chunk_mutex); 4230 + /* 4231 + * When we allocate a new chunk we reserve space in the chunk block 4232 + * reserve to make sure we can COW nodes/leafs in the chunk tree or 4233 + * add new nodes/leafs to it if we end up needing to do it when 4234 + * inserting the chunk item and updating device items as part of the 4235 + * second phase of chunk allocation, performed by 4236 + * btrfs_finish_chunk_alloc(). So make sure we don't accumulate a 4237 + * large number of new block groups to create in our transaction 4238 + * handle's new_bgs list to avoid exhausting the chunk block reserve 4239 + * in extreme cases - like having a single transaction create many new 4240 + * block groups when starting to write out the free space caches of all 4241 + * the block groups that were made dirty during the lifetime of the 4242 + * transaction. 4243 + */ 4244 + if (trans->chunk_bytes_reserved >= (2 * 1024 * 1024ull)) { 4245 + btrfs_create_pending_block_groups(trans, trans->root); 4246 + btrfs_trans_release_chunk_metadata(trans); 4247 + } 4230 4248 return ret; 4231 4249 } 4232 4250
+2 -1
fs/btrfs/transaction.c
··· 2152 2152 2153 2153 kmem_cache_free(btrfs_trans_handle_cachep, trans); 2154 2154 2155 - if (current != root->fs_info->transaction_kthread) 2155 + if (current != root->fs_info->transaction_kthread && 2156 + current != root->fs_info->cleaner_kthread) 2156 2157 btrfs_run_delayed_iputs(root); 2157 2158 2158 2159 return ret;