diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-02-23 21:16:41 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:53 +0200 |
commit | dab9ef0d271648c24b867059855439ec48775fc4 (patch) | |
tree | ddf192029855fb6b9498f5318e169e563397652c /fs/bcachefs/recovery.c | |
parent | bcachefs: Extents may now cross btree node boundaries (diff) | |
download | linux-dab9ef0d271648c24b867059855439ec48775fc4.tar.xz linux-dab9ef0d271648c24b867059855439ec48775fc4.zip |
bcachefs: Add error message for some allocation failures
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r-- | fs/bcachefs/recovery.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 54ac9cc470af..0aeaaadbf3f8 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -122,8 +122,11 @@ int bch2_journal_key_insert(struct bch_fs *c, enum btree_id id, }; new_keys.d = kvmalloc(sizeof(new_keys.d[0]) * new_keys.size, GFP_KERNEL); - if (!new_keys.d) + if (!new_keys.d) { + bch_err(c, "%s: error allocating new key array (size %zu)", + __func__, new_keys.size); return -ENOMEM; + } memcpy(new_keys.d, keys->d, sizeof(keys->d[0]) * keys->nr); kvfree(keys->d); @@ -145,8 +148,10 @@ int bch2_journal_key_delete(struct bch_fs *c, enum btree_id id, kmalloc(sizeof(struct bkey), GFP_KERNEL); int ret; - if (!whiteout) + if (!whiteout) { + bch_err(c, "%s: error allocating new key", __func__); return -ENOMEM; + } bkey_init(&whiteout->k); whiteout->k.p = pos; @@ -1330,8 +1335,10 @@ int bch2_fs_initialize(struct bch_fs *c) &lostfound, 0, 0, S_IFDIR|0700, 0, NULL, NULL)); - if (ret) + if (ret) { + bch_err(c, "error creating lost+found"); goto err; + } if (enabled_qtypes(c)) { ret = bch2_fs_quota_read(c); |