summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-05-07 09:11:02 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-08-28 19:15:16 -0800
commit34cd89b81a783a5324baf05bbe2dbfae5d9a2df0 (patch)
treeb8e4ee1ae4b8562743034b0ad5b54b56c5c7f2c2
parent691e6b0cf4d70de4c0d45ed7b5e2eb3f0b33c086 (diff)
bcache: Fall back to allocating from all devices for btree nodes
-rw-r--r--drivers/md/bcache/alloc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index 4143221e28aa..3cba2762a8be 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -1280,6 +1280,7 @@ static int open_bucket_add_buckets(struct cache_set *c,
const struct bch_extent_ptr *ptr;
long caches_used[BITS_TO_LONGS(MAX_CACHES_PER_SET)];
unsigned i, end;
+ int ret;
/*
* We might be allocating pointers to add to an existing extent
@@ -1319,8 +1320,13 @@ static int open_bucket_add_buckets(struct cache_set *c,
}
}
- return bch_bucket_alloc_set(c, ob, wp->reserve, nr_replicas,
- wp->group, caches_used, cl);
+ ret = bch_bucket_alloc_set(c, ob, wp->reserve, nr_replicas,
+ wp->group, caches_used, cl);
+ if (ret && wp == &c->btree_write_point)
+ ret = bch_bucket_alloc_set(c, ob, wp->reserve, nr_replicas,
+ &c->cache_all, caches_used, cl);
+
+ return ret;
}
/*