summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 917575597ce5..a0b455b343ac 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -1094,7 +1094,11 @@ static int bch2_mark_stripe(struct btree_trans *trans,
spin_unlock(&c->ec_stripes_heap_lock);
}
} else {
- struct gc_stripe *m = genradix_ptr(&c->gc_stripes, idx);
+ struct gc_stripe *m =
+ genradix_ptr_alloc(&c->gc_stripes, idx, GFP_KERNEL);
+
+ if (!m)
+ return -ENOMEM;
/*
* This will be wrong when we bring back runtime gc: we should