aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/movinggc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-05-24 14:45:33 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:22 -0400
commit5884fddfe732183aa2be4d11444543dfae6e044b (patch)
tree2cd10e953943dbdb761d85f3b79b282798682222 /fs/bcachefs/movinggc.c
parent37dd783474d07f8aa210ecf5cc82fd900417eb8b (diff)
bcachefs: Fix starting copygc when already started
We can sometimes call bch2_dev_read_write() when the device is already RW (in error paths). Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/movinggc.c')
-rw-r--r--fs/bcachefs/movinggc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index d97be76da58f..44e235ef3de0 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -283,7 +283,8 @@ int bch2_copygc_start(struct bch_fs *c, struct bch_dev *ca)
{
struct task_struct *t;
- BUG_ON(ca->copygc_thread);
+ if (ca->copygc_thread)
+ return 0;
if (c->opts.nochanges)
return 0;