History

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.

Kent Overstreet committed 2 years ago

Commit 7b474c71 parent c8296d71 file · +2 −1Browse files

Unified · Split

fs/bcachefs/data_update.c+2−1
@@ -587,7 +587,8 @@ int bch2_data_update_init(struct btree_trans *trans, · 586 unmodified lines
587 * Increasing replication is an explicit operation triggered by587 * Increasing replication is an explicit operation triggered by
588 * rereplicate, currently, so that users don't get an unexpected -ENOSPC588 * rereplicate, currently, so that users don't get an unexpected -ENOSPC
589 */589 */
590 if (durability_have >= io_opts.data_replicas) {590 if (!(m->data_opts.write_flags & BCH_WRITE_CACHED) &&
591 durability_have >= io_opts.data_replicas) {
591 m->data_opts.kill_ptrs |= m->data_opts.rewrite_ptrs;592 m->data_opts.kill_ptrs |= m->data_opts.rewrite_ptrs;
592 m->data_opts.rewrite_ptrs = 0;593 m->data_opts.rewrite_ptrs = 0;
593 /* if iter == NULL, it's just a promote */594 /* if iter == NULL, it's just a promote */