From a8cee91929695f4507a3e5d9eb53be2d768418d0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 12 Jun 2020 17:00:48 +0100 Subject: [PATCH] check: Fix misleading message which printed errors instead of differences See: https://forum.rclone.org/t/tons-of-data-corruption-after-rclone-copy-to-mega-can-rclone-correct-it/17017/7 --- fs/operations/operations.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index adf32e072..bbffb18a2 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -900,7 +900,10 @@ func CheckFn(ctx context.Context, fdst, fsrc fs.Fs, check checkFn, oneway bool) fs.Logf(fsrc, "%d files missing", c.srcFilesMissing) } - fs.Logf(fdst, "%d differences found", accounting.Stats(ctx).GetErrors()) + fs.Logf(fdst, "%d differences found", c.differences) + if errs := accounting.Stats(ctx).GetErrors(); errs > 0 { + fs.Logf(fdst, "%d errors while checking", errs) + } if c.noHashes > 0 { fs.Logf(fdst, "%d hashes could not be checked", c.noHashes) }