bcachefs: Don't stop copygc while removing devices
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 9 Oct 2022 08:26:06 +0000 (04:26 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:51 +0000 (17:09 -0400)
With the new backpointer based copygc we don't need an explicit copygc
reserve, we're always evacuating buckets one at a time - so this is no
longer needed, and in fact removing it fixes a deadlock in
bch2_dev_allocator_remove().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super.c

index c5efaa7d38a8bf6f3b1c7c468601640e70ebe2cb..2fb7e6300ea5ed06fdfc5f46b6374d8de3281c91 100644 (file)
@@ -1345,19 +1345,11 @@ static bool bch2_fs_may_start(struct bch_fs *c)
 
 static void __bch2_dev_read_only(struct bch_fs *c, struct bch_dev *ca)
 {
-       /*
-        * Device going read only means the copygc reserve get smaller, so we
-        * don't want that happening while copygc is in progress:
-        */
-       bch2_copygc_stop(c);
-
        /*
         * The allocator thread itself allocates btree nodes, so stop it first:
         */
        bch2_dev_allocator_remove(c, ca);
        bch2_dev_journal_stop(&c->journal, ca);
-
-       bch2_copygc_start(c);
 }
 
 static void __bch2_dev_read_write(struct bch_fs *c, struct bch_dev *ca)