From 3782c4abe0228228bc73fa8c255be830ce1845c5 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 5 Dec 2015 17:52:45 -0800 Subject: [PATCH] fs: Make sure to negate the seeked offset if size is not negative. --- pkg/client/fs/fs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/client/fs/fs.go b/pkg/client/fs/fs.go index b440dd5e..fc859a07 100644 --- a/pkg/client/fs/fs.go +++ b/pkg/client/fs/fs.go @@ -113,7 +113,7 @@ func (f *fsClient) Put(data io.ReadSeeker, size int64, contentType string) *prob if size < 0 { // Read till EOF. _, e = io.Copy(partFile, data) } else { // Read till N bytes. - _, e = io.CopyN(partFile, data, size) + _, e = io.CopyN(partFile, data, size-partSt.Size()) } if e != nil { err := f.toClientError(e, objectPartPath)