You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge 4.2-rc6 into char-misc-next
We want the fixes in Linus's tree in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -378,7 +378,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
|
||||
|
||||
ret = btrfs_kobj_add_device(tgt_device->fs_devices, tgt_device);
|
||||
if (ret)
|
||||
btrfs_error(root->fs_info, ret, "kobj add dev failed");
|
||||
btrfs_err(root->fs_info, "kobj add dev failed %d\n", ret);
|
||||
|
||||
printk_in_rcu(KERN_INFO
|
||||
"BTRFS: dev_replace from %s (devid %llu) to %s started\n",
|
||||
|
||||
+2
-1
@@ -2842,6 +2842,7 @@ int open_ctree(struct super_block *sb,
|
||||
!extent_buffer_uptodate(chunk_root->node)) {
|
||||
printk(KERN_ERR "BTRFS: failed to read chunk root on %s\n",
|
||||
sb->s_id);
|
||||
chunk_root->node = NULL;
|
||||
goto fail_tree_roots;
|
||||
}
|
||||
btrfs_set_root_node(&chunk_root->root_item, chunk_root->node);
|
||||
@@ -2879,7 +2880,7 @@ retry_root_backup:
|
||||
!extent_buffer_uptodate(tree_root->node)) {
|
||||
printk(KERN_WARNING "BTRFS: failed to read tree root on %s\n",
|
||||
sb->s_id);
|
||||
|
||||
tree_root->node = NULL;
|
||||
goto recovery_tree_root;
|
||||
}
|
||||
|
||||
|
||||
@@ -4227,6 +4227,24 @@ out:
|
||||
space_info->chunk_alloc = 0;
|
||||
spin_unlock(&space_info->lock);
|
||||
mutex_unlock(&fs_info->chunk_mutex);
|
||||
/*
|
||||
* When we allocate a new chunk we reserve space in the chunk block
|
||||
* reserve to make sure we can COW nodes/leafs in the chunk tree or
|
||||
* add new nodes/leafs to it if we end up needing to do it when
|
||||
* inserting the chunk item and updating device items as part of the
|
||||
* second phase of chunk allocation, performed by
|
||||
* btrfs_finish_chunk_alloc(). So make sure we don't accumulate a
|
||||
* large number of new block groups to create in our transaction
|
||||
* handle's new_bgs list to avoid exhausting the chunk block reserve
|
||||
* in extreme cases - like having a single transaction create many new
|
||||
* block groups when starting to write out the free space caches of all
|
||||
* the block groups that were made dirty during the lifetime of the
|
||||
* transaction.
|
||||
*/
|
||||
if (trans->chunk_bytes_reserved >= (2 * 1024 * 1024ull)) {
|
||||
btrfs_create_pending_block_groups(trans, trans->root);
|
||||
btrfs_trans_release_chunk_metadata(trans);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -1651,6 +1651,11 @@ static int qgroup_update_counters(struct btrfs_fs_info *fs_info,
|
||||
/* Exclusive -> exclusive, nothing changed */
|
||||
}
|
||||
}
|
||||
|
||||
/* For exclusive extent, free its reserved bytes too */
|
||||
if (nr_old_roots == 0 && nr_new_roots == 1 &&
|
||||
cur_new_count == nr_new_roots)
|
||||
qg->reserved -= num_bytes;
|
||||
if (dirty)
|
||||
qgroup_dirty(fs_info, qg);
|
||||
}
|
||||
|
||||
@@ -2152,7 +2152,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
|
||||
|
||||
kmem_cache_free(btrfs_trans_handle_cachep, trans);
|
||||
|
||||
if (current != root->fs_info->transaction_kthread)
|
||||
if (current != root->fs_info->transaction_kthread &&
|
||||
current != root->fs_info->cleaner_kthread)
|
||||
btrfs_run_delayed_iputs(root);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user