summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/alloc.c')
-rw-r--r--libbcachefs/alloc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libbcachefs/alloc.c b/libbcachefs/alloc.c
index 22dcaeb2..ede44f73 100644
--- a/libbcachefs/alloc.c
+++ b/libbcachefs/alloc.c
@@ -1253,7 +1253,9 @@ static enum bucket_alloc_ret __bch2_bucket_alloc_set(struct bch_fs *c,
if (!ca)
continue;
- if (have_cache_dev && !ca->mi.durability)
+ if (!ca->mi.durability &&
+ (have_cache_dev ||
+ wp->type != BCH_DATA_USER))
continue;
ob = bch2_bucket_alloc(c, ca, reserve,
@@ -1534,11 +1536,6 @@ struct write_point *bch2_alloc_sectors_start(struct bch_fs *c,
wp->first_ptr++;
}
- ret = open_bucket_add_buckets(c, target, wp, devs_have,
- nr_replicas, reserve, cl);
- if (ret && ret != -EROFS)
- goto err;
-
if (flags & BCH_WRITE_ONLY_SPECIFIED_DEVS) {
ret = open_bucket_add_buckets(c, target, wp, devs_have,
nr_replicas, reserve, cl);