From 40a18fe27335706789b1322934f4d8b458f302e3 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 14 Mar 2023 16:21:16 -0400 Subject: [PATCH] bcachefs: Add error message for failing to allocate sorted journal keys Signed-off-by: Kent Overstreet --- fs/bcachefs/recovery.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 137e523bb7ea..73f7663cbd3f 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -502,8 +502,11 @@ static int journal_keys_sort(struct bch_fs *c) keys->size = roundup_pow_of_two(nr_keys); keys->d = kvmalloc_array(keys->size, sizeof(keys->d[0]), GFP_KERNEL); - if (!keys->d) + if (!keys->d) { + bch_err(c, "Failed to allocate buffer for sorted journal keys (%zu keys)", + nr_keys); return -BCH_ERR_ENOMEM_journal_keys_sort; + } genradix_for_each(&c->journal_entries, iter, _i) { i = *_i; -- 2.25.1