]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Self healing writes are BCH_WRITE_alloc_nowait
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 18 Jan 2025 07:05:57 +0000 (02:05 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 15 Mar 2025 01:02:11 +0000 (21:02 -0400)
If a drive is failing and we're moving data off of it, we can't
necessairly depend on capacity/disk reservation calculations to avoid
deadlocking/blocking on the allocator.

And, we don't want to queue up infinite self healing moves anyways.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/io_read.c

index 7a66feb1c011e486601a1e7b36fc9770a65c4fac..bdb554f6db8c6c7445cc73a1b519f3d67fe91fc3 100644 (file)
@@ -188,12 +188,12 @@ static struct bch_read_bio *__promote_alloc(struct btree_trans *trans,
                goto err;
        }
 
-       struct data_update_opts update_opts = {};
+       struct data_update_opts update_opts = { .write_flags = BCH_WRITE_alloc_nowait };
 
        if (!have_io_error(failed)) {
                update_opts.target = orig->opts.promote_target;
                update_opts.extra_replicas = 1;
-               update_opts.write_flags = BCH_WRITE_alloc_nowait|BCH_WRITE_cached;
+               update_opts.write_flags |= BCH_WRITE_cached;
                update_opts.write_flags |= BCH_WRITE_only_specified_devs;
        } else {
                update_opts.target = orig->opts.foreground_target;