Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

Commit

Permalink
Resize to be an even multiple of blocksize
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Howell committed Jun 27, 2016
1 parent bdd79d3 commit f2e57b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions local_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ func NewServer(cfg Config, metadataServiceKind, blockStoreKind string) (*Server,
return nil, err
}

offset := cfg.StorageSize % global.BlockSize
if offset != 0 {
cfg.StorageSize = cfg.StorageSize - offset
clog.Infof("resizing to %v bytes to make an even multiple of blocksize: %v\n", cfg.StorageSize, global.BlockSize)
}

blocks, err := CreateBlockStore(blockStoreKind, "current", cfg, global)
if err != nil {
return nil, err
Expand Down

0 comments on commit f2e57b6

Please sign in to comment.