From: Kent Overstreet Date: Tue, 14 Mar 2023 20:21:16 +0000 (-0400) Subject: bcachefs: Add error message for failing to allocate sorted journal keys X-Git-Tag: io_uring-6.7-2023-11-10~119^2~413 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=40a18fe27335706789b1322934f4d8b458f302e3;p=linux-block.git bcachefs: Add error message for failing to allocate sorted journal keys Signed-off-by: Kent Overstreet --- 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;