mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
XL: Change AppendFile() to return only error (#1932)
AppendFile ensures that it appends the entire buffer. Returns an error otherwise, this patch removes the necessity for the caller to look for 'n' return on short writes. Ref #1893
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
e1aad066c6
commit
50d25ca94a
@@ -137,15 +137,11 @@ func appendFile(disks []StorageAPI, volume, path string, enBlocks [][]byte, dist
|
||||
defer wg.Done()
|
||||
// Pick the block from the distribution.
|
||||
blockIndex := distribution[index] - 1
|
||||
n, wErr := disk.AppendFile(volume, path, enBlocks[blockIndex])
|
||||
wErr := disk.AppendFile(volume, path, enBlocks[blockIndex])
|
||||
if wErr != nil {
|
||||
wErrs[index] = wErr
|
||||
return
|
||||
}
|
||||
if n != int64(len(enBlocks[blockIndex])) {
|
||||
wErrs[index] = errUnexpected
|
||||
return
|
||||
}
|
||||
|
||||
// Calculate hash for each blocks.
|
||||
hashWriters[blockIndex].Write(enBlocks[blockIndex])
|
||||
|
||||
Reference in New Issue
Block a user