]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Add an error message for copygc spinning
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 28 Dec 2021 02:28:50 +0000 (21:28 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:20 +0000 (17:09 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/movinggc.c

index 346b9ee667ec7e08b584f172d31f46020ab3701f..46a0875135d5424d9cdf99debd661ce55dfccb60 100644 (file)
@@ -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:
         */