The hunks of "btrfs: stripe_alloc: allow-rmw policy, and write-in-place
for isolated nocow extents" (earlier in this series) that need code from
"btrfs: stripe_alloc: settle a logged extent's stripes at log commit",
which comes after it in this series: they are applied here, once "btrfs:
stripe_alloc: settle a logged extent's stripes at log commit" is in,
instead of with the rest of "btrfs: stripe_alloc: allow-rmw policy, and
write-in-place for isolated nocow extents".
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-opus-5-5
u64 flush_start = 0;
u64 flush_len = 0;
+ /* stripe_alloc_allow_rmw=fsync waives the log-commit guarantee. */
+ if (btrfs_stripe_allow_rmw(fs_info) & BTRFS_STRIPE_RMW_FSYNC)
+ return;
if (list_empty_careful(&fs_info->open_stripe_bgs))
return;
bg = btrfs_lookup_block_group(fs_info, bytenr);
list_for_each_entry(run, &bg->open_stripe_runs, list) {
if (bytenr < run->start || bytenr >= run->offset)
continue;
+ /*
+ * A nodatacow file's logged extents get no fsync survival
+ * guarantee -- the file's own later in-place writes can
+ * always tear them -- so closing its run would trap the
+ * tail for nothing.
+ */
+ if (run->class == BTRFS_STRIPE_RUN_NOCOW)
+ break;
flush_start = run->start;
flush_len = run->end - run->start;
if (run->open) {