client: use 64-bit value in sync read eof logic

The file size can jump to a value that is very much larger than our current
position (for example, it could be a disk image file that gets a sparse
write at a large offset).  Use a 64-bit value so that 'some' doesn't
overflow.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: John Spray <john.spray@inktank.com>
This commit is contained in:
Sage Weil 2014-02-03 08:54:14 -08:00
parent 560f5f1f88
commit 7ff2b541c2

View File

@ -5971,7 +5971,7 @@ int Client::_read_sync(Fh *f, uint64_t off, uint64_t len, bufferlist *bl)
if (r >= 0 && r < wanted) {
if (pos < in->size) {
// zero up to known EOF
int some = in->size - pos;
int64_t some = in->size - pos;
if (some > left)
some = left;
bufferptr z(some);