Commit d90c8acd authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: rebalance writes use BCH_WRITE_ONLY_SPECIFIED_DEVS

this was an oversight: rebalance is moving data to a specific device, so
we don't want it falling back to the full filesystem
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a977f3e1
...@@ -1389,8 +1389,6 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans, ...@@ -1389,8 +1389,6 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans,
if (!IS_ENABLED(CONFIG_BCACHEFS_ERASURE_CODING)) if (!IS_ENABLED(CONFIG_BCACHEFS_ERASURE_CODING))
erasure_code = false; erasure_code = false;
BUG_ON(flags & BCH_WRITE_ONLY_SPECIFIED_DEVS);
BUG_ON(!nr_replicas || !nr_replicas_required); BUG_ON(!nr_replicas || !nr_replicas_required);
retry: retry:
ptrs.nr = 0; ptrs.nr = 0;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "errcode.h" #include "errcode.h"
#include "error.h" #include "error.h"
#include "inode.h" #include "inode.h"
#include "io_write.h"
#include "move.h" #include "move.h"
#include "rebalance.h" #include "rebalance.h"
#include "subvolume.h" #include "subvolume.h"
...@@ -156,6 +157,7 @@ static struct bkey_s_c next_rebalance_extent(struct btree_trans *trans, ...@@ -156,6 +157,7 @@ static struct bkey_s_c next_rebalance_extent(struct btree_trans *trans,
data_opts->rewrite_ptrs = data_opts->rewrite_ptrs =
bch2_bkey_ptrs_need_rebalance(c, k, r->target, r->compression); bch2_bkey_ptrs_need_rebalance(c, k, r->target, r->compression);
data_opts->target = r->target; data_opts->target = r->target;
data_opts->write_flags |= BCH_WRITE_ONLY_SPECIFIED_DEVS;
if (!data_opts->rewrite_ptrs) { if (!data_opts->rewrite_ptrs) {
/* /*
...@@ -263,6 +265,7 @@ static bool rebalance_pred(struct bch_fs *c, void *arg, ...@@ -263,6 +265,7 @@ static bool rebalance_pred(struct bch_fs *c, void *arg,
data_opts->rewrite_ptrs = bch2_bkey_ptrs_need_rebalance(c, k, target, compression); data_opts->rewrite_ptrs = bch2_bkey_ptrs_need_rebalance(c, k, target, compression);
data_opts->target = target; data_opts->target = target;
data_opts->write_flags |= BCH_WRITE_ONLY_SPECIFIED_DEVS;
return data_opts->rewrite_ptrs != 0; return data_opts->rewrite_ptrs != 0;
} }
......
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