bcachefs: Fix a deadlock
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 17 Mar 2019 20:49:59 +0000 (16:49 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:18 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/migrate.c

index 955831a508240dd6198448b09025cd3041e86294..38bf75b6bc2d63be62471d2d4f9c28c00efad3dc 100644 (file)
@@ -96,11 +96,11 @@ static int bch2_dev_usrdata_drop(struct bch_fs *c, unsigned dev_idx, int flags)
                        break;
        }
 
+       bch2_trans_exit(&trans);
+
        bch2_replicas_gc_end(c, ret);
        mutex_unlock(&c->replicas_gc_lock);
 
-       bch2_trans_exit(&trans);
-
        return ret;
 }