summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-03-15 21:03:12 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-05-22 00:44:18 -0400
commita9b16bc03002954d6faae12e26a8e704fce32cc9 (patch)
treebc3e5c14acc59addc0068ea741dec0788289181a
parent619e80e6da64b1ba08e92fcc4ce8536e4f74c8c5 (diff)
bcachefs: fix another writethrough bug
-rw-r--r--fs/bcachefs/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index f67d278d754c..739543fd572a 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -734,13 +734,13 @@ 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));
return;
}
- /* for the device pointers and 1 for the chksum */
if (bch2_keylist_realloc(&op->insert_keys,
op->inline_keys,
ARRAY_SIZE(op->inline_keys),