diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-11 03:01:40 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-14 02:33:38 +0100 |
commit | 4e07447503f01766ae976207eb3b947437ed8dbc (patch) | |
tree | 243df9d99400741610eaaf1238810a09384bd6e4 /fs/bcachefs/io_write.c | |
parent | bcachefs: fix missing endiannes conversion in sb_members (diff) | |
download | linux-4e07447503f01766ae976207eb3b947437ed8dbc.tar.xz linux-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/io_write.c')
-rw-r--r-- | fs/bcachefs/io_write.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c index ef3a53f9045a..2c098ac017b3 100644 --- a/fs/bcachefs/io_write.c +++ b/fs/bcachefs/io_write.c @@ -1564,6 +1564,7 @@ CLOSURE_CALLBACK(bch2_write) BUG_ON(!op->write_point.v); BUG_ON(bkey_eq(op->pos, POS_MAX)); + op->nr_replicas_required = min_t(unsigned, op->nr_replicas_required, op->nr_replicas); op->start_time = local_clock(); bch2_keylist_init(&op->insert_keys, op->inline_keys); wbio_init(bio)->put_bio = false; |