summaryrefslogtreecommitdiff
path: root/libbcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-08-11 22:22:59 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-08-11 22:25:12 -0400
commitf3976e3733e97a0e96f5fc6349d1e82b25116043 (patch)
tree87ab725ba56735f2157e77dc6bc4bc1c910890b2 /libbcachefs/super.c
parentbcee0320dcb53adb3786330a00a101840f2939d0 (diff)
Update bcachefs sources to b0788c47d9 bcachefs: Fix check_version_upgrade()
Diffstat (limited to 'libbcachefs/super.c')
-rw-r--r--libbcachefs/super.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libbcachefs/super.c b/libbcachefs/super.c
index 82e992b3..5c62fcf3 100644
--- a/libbcachefs/super.c
+++ b/libbcachefs/super.c
@@ -574,13 +574,6 @@ void __bch2_fs_stop(struct bch_fs *c)
cancel_work_sync(&ca->io_error_work);
cancel_work_sync(&c->read_only_work);
-
- for (i = 0; i < c->sb.nr_devices; i++) {
- struct bch_dev *ca = rcu_dereference_protected(c->devs[i], true);
-
- if (ca)
- bch2_free_super(&ca->disk_sb);
- }
}
void bch2_fs_free(struct bch_fs *c)
@@ -594,9 +587,14 @@ void bch2_fs_free(struct bch_fs *c)
closure_sync(&c->cl);
closure_debug_destroy(&c->cl);
- for (i = 0; i < c->sb.nr_devices; i++)
- if (c->devs[i])
- bch2_dev_free(rcu_dereference_protected(c->devs[i], 1));
+ for (i = 0; i < c->sb.nr_devices; i++) {
+ struct bch_dev *ca = rcu_dereference_protected(c->devs[i], true);
+
+ if (ca) {
+ bch2_free_super(&ca->disk_sb);
+ bch2_dev_free(ca);
+ }
+ }
bch_verbose(c, "shutdown complete");