summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2015-08-20 12:46:47 +0200
committerJeff Cody <jcody@redhat.com>2015-09-25 08:37:07 -0400
commit055c6f912c8d3cd9a901972ae432c47e5872f71a (patch)
treea5a9d7abe8209018d398d5c0a081007bfcbd57a5 /block
parenteb9d0ea063fc7bdfab76b84085602a9e48d13ec7 (diff)
downloadhqemu-055c6f912c8d3cd9a901972ae432c47e5872f71a.zip
hqemu-055c6f912c8d3cd9a901972ae432c47e5872f71a.tar.gz
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>
Diffstat (limited to 'block')
-rw-r--r--block/nfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/nfs.c b/block/nfs.c
index c026ff6..02eb4e4 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -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)
OpenPOWER on IntegriCloud