From: Kent Overstreet Date: Fri, 24 May 2019 18:45:33 +0000 (-0400) Subject: bcachefs: Fix starting copygc when already started X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5884fddfe732183aa2be4d11444543dfae6e044b;p=linux.git 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 --- diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index d97be76da58fc..44e235ef3de01 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;