Browse Source

hard limit volume file size

pull/1360/head
Chris Lu 5 years ago
parent
commit
7ccc31853c
  1. 4
      weed/storage/needle/needle_read_write.go

4
weed/storage/needle/needle_read_write.go

@ -140,6 +140,10 @@ func (n *Needle) Append(w backend.BackendStorageFile, version Version) (offset u
err = fmt.Errorf("Cannot Read Current Volume Position: %v", e) err = fmt.Errorf("Cannot Read Current Volume Position: %v", e)
return return
} }
if offset >= MaxPossibleVolumeSize {
err = fmt.Errorf("Volume Size %d Exeededs %d", offset, MaxPossibleVolumeSize)
return
}
bytesToWrite, size, actualSize, err := n.prepareWriteBuffer(version) bytesToWrite, size, actualSize, err := n.prepareWriteBuffer(version)

Loading…
Cancel
Save