From ec28e6bfa269daf953af95610c0d1af3e7df1c0a Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 15 Mar 2023 08:59:01 -0400 Subject: Update bcachefs sources to 0342eebf85 bcachefs: Improve the backpointer to missing extent message --- libbcachefs/super-io.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libbcachefs/super-io.c') diff --git a/libbcachefs/super-io.c b/libbcachefs/super-io.c index b9af7820..519df099 100644 --- a/libbcachefs/super-io.c +++ b/libbcachefs/super-io.c @@ -136,14 +136,14 @@ int bch2_sb_realloc(struct bch_sb_handle *sb, unsigned u64s) return 0; if (dynamic_fault("bcachefs:add:super_realloc")) - return -ENOMEM; + return -BCH_ERR_ENOMEM_sb_realloc_injected; if (sb->have_bio) { unsigned nr_bvecs = DIV_ROUND_UP(new_buffer_size, PAGE_SIZE); bio = bio_kmalloc(nr_bvecs, GFP_KERNEL); if (!bio) - return -ENOMEM; + return -BCH_ERR_ENOMEM_sb_bio_realloc; bio_init(bio, NULL, bio->bi_inline_vecs, nr_bvecs, 0); @@ -153,7 +153,7 @@ int bch2_sb_realloc(struct bch_sb_handle *sb, unsigned u64s) new_sb = krealloc(sb->sb, new_buffer_size, GFP_NOFS|__GFP_ZERO); if (!new_sb) - return -ENOMEM; + return -BCH_ERR_ENOMEM_sb_buf_realloc; sb->sb = new_sb; sb->buffer_size = new_buffer_size; @@ -559,8 +559,9 @@ reread: } if (bytes > sb->buffer_size) { - if (bch2_sb_realloc(sb, le32_to_cpu(sb->sb->u64s))) - return -ENOMEM; + ret = bch2_sb_realloc(sb, le32_to_cpu(sb->sb->u64s)); + if (ret) + return ret; goto reread; } -- cgit v1.2.3