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>
This commit is contained in:
Kent Overstreet 2019-05-24 14:45:33 -04:00 committed by Kent Overstreet
parent 37dd783474
commit 5884fddfe7

View File

@ -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;