From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcqk-0001ds-7K for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:42:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUcqf-0004RS-Id for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:42:54 -0400 Date: Wed, 26 Aug 2015 11:42:41 -0400 From: Jeff Cody Message-ID: <20150826154241.GI11016@localhost.localdomain> References: <1440067607-14547-1-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440067607-14547-1-git-send-email-pl@kamp.de> Subject: Re: [Qemu-devel] [PATCH] block/nfs: fix calculation of allocated file size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-stable@nongnu.org On Thu, Aug 20, 2015 at 12:46:47PM +0200, Peter Lieven wrote: > 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 > --- > 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 > Reviewed-by: Jeff Cody