From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zoxbh-0006QW-VM for qemu-devel@nongnu.org; Wed, 21 Oct 2015 13:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zoxbd-0006sP-Tx for qemu-devel@nongnu.org; Wed, 21 Oct 2015 13:55:25 -0400 Received: from e19.ny.us.ibm.com ([129.33.205.209]:57975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zoxbd-0006sC-Po for qemu-devel@nongnu.org; Wed, 21 Oct 2015 13:55:21 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Oct 2015 13:55:21 -0400 From: Michael Roth Date: Wed, 21 Oct 2015 12:51:36 -0500 Message-Id: <1445449930-23525-7-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1445449930-23525-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1445449930-23525-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 06/40] block/nfs: fix calculation of allocated file size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jeff Cody , Peter Lieven , qemu-stable@nongnu.org, Michael Roth From: Peter Lieven 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 Reviewed-by: Max Reitz Reviewed-by: Jeff Cody Message-id: 1440067607-14547-1-git-send-email-pl@kamp.de Signed-off-by: Jeff Cody (cherry picked from commit 055c6f912c8d3cd9a901972ae432c47e5872f71a) Signed-off-by: Michael Roth --- block/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 1.9.1