summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-14 16:21:16 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:57 -0400
commit40a18fe27335706789b1322934f4d8b458f302e3 (patch)
tree67252841a514ea6f5b71a23b290bcaa0bb9958d7 /fs
parentb40901b0f7182557851c8e9af31bacfbbd76b1ec (diff)
downloadlwn-40a18fe27335706789b1322934f4d8b458f302e3.tar.gz
lwn-40a18fe27335706789b1322934f4d8b458f302e3.zip
bcachefs: Add error message for failing to allocate sorted journal keys
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/recovery.c5
1 files changed, 4 insertions, 1 deletions
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;