summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-01-18 02:05:57 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-06 18:15:02 -0500
commit0dc4a9687251a2076a4145d190f41c6086a0d8a4 (patch)
treec8d86cd39f484225919c5d77df48dbdd305065ce
parentcaee3f6e11ad6ed509705a4047dbdefdc0f82cde (diff)
bcachefs: Self healing writes are BCH_WRITE_alloc_nowait
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>
-rw-r--r--fs/bcachefs/io_read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/io_read.c b/fs/bcachefs/io_read.c
index fcaf9c40cb11..1dfd5a346f17 100644
--- a/fs/bcachefs/io_read.c
+++ b/fs/bcachefs/io_read.c
@@ -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;