Skip to content
Commit 4be214c2 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: bch2_bkey_sectors_need_rebalance() now only depends on bch_extent_rebalance



Previously, bch2_bkey_sectors_need_rebalance() called
bch2_target_accepts_data(), checking whether the target is writable.

However, this means that adding or removing devices from a target would
change the value of bch2_bkey_sectors_need_rebalance() for an existing
extent; this needs to be invariant so that the extent trigger can
correctly maintain rebalance_work accounting.

Instead, check target_accepts_data() in io_opts_to_rebalance_opts(),
before creating the bch_extent_rebalance entry.

This fixes (one?) cause of rebalance_work accounting being off.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 3539880e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment