The hunks of "btrfs: stripe_alloc: track per-sector liveness and pad
from the map" (earlier in this series) that need code from "btrfs:
stripe_alloc: allow-rmw policy, and write-in-place for isolated nocow
extents", which comes after it in this series: they are applied here,
once "btrfs: stripe_alloc: allow-rmw policy, and write-in-place for
isolated nocow extents" is in, instead of with the rest of "btrfs:
stripe_alloc: track per-sector liveness and pad from the map".
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-opus-5-5
return false;
spin_lock_irqsave(&bg->stripe_run_lock, flags);
list_for_each_entry(run, &bg->open_stripe_runs, list) {
- if (logical >= run->start && logical < run->end) {
- if (class)
- *class = run->class;
- ret = true;
- break;
- }
+ if (logical < run->start || logical >= run->end)
+ continue;
+ /*
+ * Draining runs match too (see btrfs_stripe_in_open_run()):
+ * a closed run's end is shrunk to its frontier, so a write
+ * into it is below the frontier and its stripes are still
+ * exclusive.
+ */
+ if (class)
+ *class = run->class;
+ ret = true;
+ break;
}
spin_unlock_irqrestore(&bg->stripe_run_lock, flags);
btrfs_put_block_group(bg);