summaryrefslogtreecommitdiff
path: root/libbcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-05-04 15:38:06 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-04 15:52:42 -0400
commit401a20ed984b7ccee689202d9372045d41271bcc (patch)
tree61a8553d25b04459593fca2c350dfcb7def76150 /libbcachefs/recovery.c
parent6e4bda5ad5f7a43b90d9f22b8e86011e51569bf1 (diff)
Update bcachefs sources to b4927db2cdc7 bcachefs: bcachefs_metadata_version_fast_device_removal
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/recovery.c')
-rw-r--r--libbcachefs/recovery.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libbcachefs/recovery.c b/libbcachefs/recovery.c
index 6aae686f..375111b5 100644
--- a/libbcachefs/recovery.c
+++ b/libbcachefs/recovery.c
@@ -737,11 +737,6 @@ int bch2_fs_recovery(struct bch_fs *c)
c->opts.read_only = true;
}
- if (c->sb.features & BIT_ULL(BCH_FEATURE_small_image)) {
- bch_info(c, "filesystem is an unresized image file, mounting ro");
- c->opts.read_only = true;
- }
-
mutex_lock(&c->sb_lock);
struct bch_sb_field_ext *ext = bch2_sb_field_get(c->disk_sb.sb, ext);
bool write_sb = false;
@@ -895,6 +890,17 @@ use_clean:
if (ret)
goto err;
+ ret = bch2_fs_resize_on_mount(c);
+ if (ret) {
+ up_write(&c->state_lock);
+ goto err;
+ }
+
+ if (c->sb.features & BIT_ULL(BCH_FEATURE_small_image)) {
+ bch_info(c, "filesystem is an unresized image file, mounting ro");
+ c->opts.read_only = true;
+ }
+
if (!c->opts.read_only &&
(c->sb.features & BIT_ULL(BCH_FEATURE_no_alloc_info))) {
bch_info(c, "mounting a filesystem with no alloc info read-write; will recreate");