From: Kent Overstreet Date: Tue, 28 Dec 2021 02:28:50 +0000 (-0500) Subject: bcachefs: Add an error message for copygc spinning X-Git-Tag: v6.7-rc1~201^2~1213 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=200472e91c6c6745e6ddf42d1b33265f84b26e68;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Add an error message for copygc spinning Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index 346b9ee667ec7..46a0875135d54 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -205,6 +205,11 @@ static int bch2_copygc(struct bch_fs *c) up_read(&ca->bucket_lock); } + if (!h->used) { + bch_err_ratelimited(c, "copygc requested to run but found no buckets to move!"); + return 0; + } + /* * Our btree node allocations also come out of RESERVE_MOVINGGC: */