mirror of
https://github.com/ceph/ceph
synced 2025-01-20 10:01:45 +00:00
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:
parent
560f5f1f88
commit
7ff2b541c2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user