diff --git a/rbd/rbd.go b/rbd/rbd.go index 5b1a1e5..5b77aae 100644 --- a/rbd/rbd.go +++ b/rbd/rbd.go @@ -955,7 +955,7 @@ func (image *Image) Discard(ofs uint64, length uint64) (int, error) { return int(ret), nil } -func (image *Image) ReadAt(data []byte, off int64) (n int, err error) { +func (image *Image) ReadAt(data []byte, off int64) (int, error) { if err := image.validate(imageIsOpen); err != nil { return 0, err } @@ -974,7 +974,7 @@ func (image *Image) ReadAt(data []byte, off int64) (n int, err error) { return 0, RBDError(ret) } - if ret < n { + if ret < len(data) { return ret, io.EOF }