Skip to content

Commit

Permalink
Merge pull request restic#3327 from MichaelEischer/fix-s3-sanity-check
Browse files Browse the repository at this point in the history
s3: Fix sanity check
  • Loading branch information
fd0 committed Mar 11, 2021
2 parents e678aca + 2a9f0f1 commit 88a2352
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/backend/s3/s3.go
Expand Up @@ -277,7 +277,7 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe
debug.Log("%v -> %v bytes, err %#v: %v", objName, info.Size, err, err)

// sanity check
if err != nil && info.Size != rd.Length() {
if err == nil && info.Size != rd.Length() {
return errors.Errorf("wrote %d bytes instead of the expected %d bytes", info.Size, rd.Length())
}

Expand Down

0 comments on commit 88a2352

Please sign in to comment.