qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Peter Lieven <pl@kamp.de>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block/nfs: fix calculation of allocated file size
Date: Wed, 26 Aug 2015 11:42:41 -0400	[thread overview]
Message-ID: <20150826154241.GI11016@localhost.localdomain> (raw)
In-Reply-To: <1440067607-14547-1-git-send-email-pl@kamp.de>

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 <pl@kamp.de>
> ---
>  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 <jcody@redhat.com>

  parent reply	other threads:[~2015-08-26 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20 10:46 [Qemu-devel] [PATCH] block/nfs: fix calculation of allocated file size Peter Lieven
2015-08-21 16:33 ` Max Reitz
2015-08-26 15:42 ` Jeff Cody [this message]
2015-08-26 18:38 ` Jeff Cody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150826154241.GI11016@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).