summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-01-02 21:03:48 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-05-22 00:44:18 -0400
commitee5722c05582082b31a9b6e51483577e510357cd (patch)
tree312cde2cb6d78927a77d1320d7df2f511486b006
parent6f48bf2ccc1b25ed0b4629193014fc8f33da3ba3 (diff)
bcachefs: fix another lockdep splat
-rw-r--r--fs/bcachefs/alloc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/bcachefs/alloc.c b/fs/bcachefs/alloc.c
index ec02adc0d20c..0c239212d427 100644
--- a/fs/bcachefs/alloc.c
+++ b/fs/bcachefs/alloc.c
@@ -1065,13 +1065,9 @@ static long bch2_bucket_alloc_startup(struct bch_fs *c, struct bch_dev *ca)
return -1;
}
- spin_unlock(&c->freelist_lock);
-
- down_read(&ca->bucket_lock);
+ rcu_read_lock();
buckets = bucket_array(ca);
- spin_lock(&c->freelist_lock);
-
for (b = ca->mi.first_bucket; b < ca->mi.nbuckets; b++)
if (is_startup_available_bucket(buckets->b[b].mark) &&
bch2_mark_alloc_bucket_startup(c, ca, b)) {
@@ -1080,7 +1076,7 @@ static long bch2_bucket_alloc_startup(struct bch_fs *c, struct bch_dev *ca)
}
b = -1;
success:
- up_read(&ca->bucket_lock);
+ rcu_read_unlock();
up_read(&c->gc_lock);
return b;
}