diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-10 21:01:40 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-13 20:33:38 -0500 |
commit | 4e07447503f01766ae976207eb3b947437ed8dbc (patch) | |
tree | 243df9d99400741610eaaf1238810a09384bd6e4 /fs/bcachefs/btree_update_interior.c | |
parent | 04eb57930e4e471d8f16455a748df2009d43c139 (diff) | |
download | linux-stable-4e07447503f01766ae976207eb3b947437ed8dbc.tar.gz linux-stable-4e07447503f01766ae976207eb3b947437ed8dbc.tar.bz2 linux-stable-4e07447503f01766ae976207eb3b947437ed8dbc.zip |
bcachefs: Clamp replicas_required to replicas
This prevents going emergency read only when the user has specified
replicas_required > replicas.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_update_interior.c')
-rw-r--r-- | fs/bcachefs/btree_update_interior.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 17a5938aa71a..4530b14ff2c3 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -280,7 +280,8 @@ retry: writepoint_ptr(&c->btree_write_point), &devs_have, res->nr_replicas, - c->opts.metadata_replicas_required, + min(res->nr_replicas, + c->opts.metadata_replicas_required), watermark, 0, cl, &wp); if (unlikely(ret)) return ERR_PTR(ret); |