]> www.infradead.org Git - users/hch/block.git/commitdiff
bcachefs: fast exit when darray_make_room failed
authorHongbo Li <lihongbo22@huawei.com>
Tue, 24 Sep 2024 01:42:24 +0000 (09:42 +0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 28 Sep 2024 01:46:34 +0000 (21:46 -0400)
In downgrade_table_extra, the return value is needed. When it
return failed, we should exit immediately.

Fixes: 7773df19c35f ("bcachefs: metadata version bucket_stripe_sectors")
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/sb-downgrade.c

index c7e4cdd3f6a521d01a1705c07553073a38076503..6f0493f79959fb9868942707841d55435b4cab09 100644 (file)
@@ -353,7 +353,9 @@ int bch2_sb_downgrade_update(struct bch_fs *c)
                for (unsigned i = 0; i < src->nr_errors; i++)
                        dst->errors[i] = cpu_to_le16(src->errors[i]);
 
-               downgrade_table_extra(c, &table);
+               ret = downgrade_table_extra(c, &table);
+               if (ret)
+                       goto out;
 
                if (!dst->recovery_passes[0] &&
                    !dst->recovery_passes[1] &&