Merge lp:~julian-edwards/gwacl/extra-putpage-checks into lp:gwacl
Proposed by
Julian Edwards
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | 132 |
Merged at revision: | 131 |
Proposed branch: | lp:~julian-edwards/gwacl/extra-putpage-checks |
Merge into: | lp:gwacl |
Diff against target: |
106 lines (+33/-5) 2 files modified
storage_base.go (+9/-0) storage_base_test.go (+24/-5) |
To merge this branch: | bzr merge lp:~julian-edwards/gwacl/extra-putpage-checks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella | Approve | ||
Review via email: mp+171008@code.launchpad.net |
Commit message
When dealing with page blobs, make sure any sizes and ranges are aligned to 512 byte boundaries.
Description of the change
Add more consistency checks around dealing with page blobs. We have to make sure any sizes and ranges are aligned to 512 byte boundaries.
To post a comment you must log in.
Looks good. Couple of points.
[1]
+ return fmt.Errorf("Size must be multiple of 512 bytes")
*a* multiple?
Here and in one other place.
[2]
+ validStart := math.Mod( float64( req.StartRange) , 512) == 0
There is a % operator in Go:
validStart := (req.StartRange % 512 == 0)