Commit 7b474c77 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix promotes

The recent work to fix data moves w.r.t. durability broke promotes,
because the caused us to bail out when the extent minus pointers being
dropped still has enough pointers to satisfy the current number of
replicas.

Disable this check when we're adding cached replicas.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent c8296d73
...@@ -587,7 +587,8 @@ int bch2_data_update_init(struct btree_trans *trans, ...@@ -587,7 +587,8 @@ int bch2_data_update_init(struct btree_trans *trans,
* Increasing replication is an explicit operation triggered by * Increasing replication is an explicit operation triggered by
* rereplicate, currently, so that users don't get an unexpected -ENOSPC * rereplicate, currently, so that users don't get an unexpected -ENOSPC
*/ */
if (durability_have >= io_opts.data_replicas) { if (!(m->data_opts.write_flags & BCH_WRITE_CACHED) &&
durability_have >= io_opts.data_replicas) {
m->data_opts.kill_ptrs |= m->data_opts.rewrite_ptrs; m->data_opts.kill_ptrs |= m->data_opts.rewrite_ptrs;
m->data_opts.rewrite_ptrs = 0; m->data_opts.rewrite_ptrs = 0;
/* if iter == NULL, it's just a promote */ /* if iter == NULL, it's just a promote */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment