summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-05-24 14:45:33 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-06-10 14:08:07 -0400
commit150819b4129ad774ae8079c7a668115c46943577 (patch)
tree12b040be38c615422cc23615b5526d99ee8b5251
parentcef5c75e273027ec4211fc9ba079aae61d49724e (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@gmail.com>
-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 4168d90c7db8..b13af5662f22 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;