From 7d32da441e49993727166a45b0420ff8be135303 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 26 Sep 2024 17:52:43 +0100 Subject: [PATCH] accounting: fix wrong message on SIGUSR2 to enable/disable bwlimit This was caused by the message code only looking at one of the bandwidth filters, not all of them. Fixes #8104 --- fs/accounting/token_bucket.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/accounting/token_bucket.go b/fs/accounting/token_bucket.go index a306096e8..a8b4bcd2d 100644 --- a/fs/accounting/token_bucket.go +++ b/fs/accounting/token_bucket.go @@ -41,7 +41,12 @@ type tokenBucket struct { // // Call with lock held func (bs *buckets) _isOff() bool { //nolint:unused // Don't include unused when running golangci-lint in case its on windows where this is not called - return bs[0] == nil + for i := range bs { + if bs[i] != nil { + return false + } + } + return true } // Disable the limits