summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-23 03:48:37 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:58 +0300
commitb1c945b3fd926ea121172eedc271f4b816b44387 (patch)
tree292cb86cbafc2f1a0ecf4563d6274232369a72be /fs/bcachefs/super.c
parent0fb11e0801962007adef5b628fec0f334e5358f2 (diff)
downloadlinux-b1c945b3fd926ea121172eedc271f4b816b44387.tar.xz
bcachefs: Run freespace init in device hot add path
Like in the recovery, and device add, we have to check if devices don't have the freespace btree initialized - this was missed in the device hot add path. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r--fs/bcachefs/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index a209de24064c..265ffa9bfd4c 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -1743,6 +1743,10 @@ int bch2_dev_online(struct bch_fs *c, const char *path)
bch2_write_super(c);
mutex_unlock(&c->sb_lock);
+ ret = bch2_fs_freespace_init(c);
+ if (ret)
+ bch_err(c, "device add error: error initializing free space: %s", bch2_err_str(ret));
+
up_write(&c->state_lock);
return 0;
err: