mirror of
https://github.com/qemu/qemu.git
synced 2024-11-25 20:03:37 +08:00
block/nfs: fix calculation of allocated file size
st.st_blocks is always counted in 512 byte units. Do not use st.st_blksize as multiplicator which may be larger. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1440067607-14547-1-git-send-email-pl@kamp.de Signed-off-by: Jeff Cody <jcody@redhat.com>
This commit is contained in:
parent
eb9d0ea063
commit
055c6f912c
@ -475,7 +475,7 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs)
|
||||
aio_poll(client->aio_context, true);
|
||||
}
|
||||
|
||||
return (task.ret < 0 ? task.ret : st.st_blocks * st.st_blksize);
|
||||
return (task.ret < 0 ? task.ret : st.st_blocks * 512);
|
||||
}
|
||||
|
||||
static int nfs_file_truncate(BlockDriverState *bs, int64_t offset)
|
||||
|
Loading…
Reference in New Issue
Block a user