operations: use correct src/dst in some log messages

Most of the time this will make no difference to user logs, however
the difference may be visible in JSON logs and on the rare occasions
src and dst are pointing to different file names.
This commit is contained in:
zzr93 2022-07-04 17:18:04 +08:00 committed by GitHub
parent 424a1f39eb
commit 060c8dfff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,7 +89,7 @@ func checkHashes(ctx context.Context, src fs.ObjectInfo, dst fs.Object, ht hash.
return dstErr
}
if dstHash == "" {
fs.Debugf(src, "Dst hash empty - aborting Src hash check")
fs.Debugf(dst, "Dst hash empty - aborting Src hash check")
return errNoHash
}
return nil
@ -100,11 +100,11 @@ func checkHashes(ctx context.Context, src fs.ObjectInfo, dst fs.Object, ht hash.
}
if srcErr != nil {
err = fs.CountError(srcErr)
fs.Errorf(dst, "Failed to calculate src hash: %v", err)
fs.Errorf(src, "Failed to calculate src hash: %v", err)
}
if dstErr != nil {
err = fs.CountError(dstErr)
fs.Errorf(src, "Failed to calculate dst hash: %v", err)
fs.Errorf(dst, "Failed to calculate dst hash: %v", err)
}
if err != nil {
return false, ht, srcHash, dstHash, err