diff options
-rw-r--r-- | fs/bcachefs/io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index d1fb89c58ee3..7ee9c3928039 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -732,11 +732,11 @@ static void __bch2_write(struct closure *cl) int ret; do { - if (op->open_buckets_nr + op->nr_replicas > + /* +1 for possible cache device: */ + if (op->open_buckets_nr + op->nr_replicas + 1 > ARRAY_SIZE(op->open_buckets)) continue_at(cl, bch2_write_index, index_update_wq(op)); - /* for the device pointers and 1 for the chksum */ if (bch2_keylist_realloc(&op->insert_keys, op->inline_keys, ARRAY_SIZE(op->inline_keys), |