All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Peter Lieven <pl@kamp.de>, qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: kwolf@redhat.com, jcody@redhat.com, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block/nfs: fix calculation of allocated file size
Date: Fri, 21 Aug 2015 09:33:30 -0700	[thread overview]
Message-ID: <55D752DA.5090400@redhat.com> (raw)
In-Reply-To: <1440067607-14547-1-git-send-email-pl@kamp.de>

On 2015-08-20 at 03:46, 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)

Reviewed-by: Max Reitz <mreitz@redhat.com>

  reply	other threads:[~2015-08-21 16:33 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 [this message]
2015-08-26 15:42 ` Jeff Cody
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=55D752DA.5090400@redhat.com \
    --to=mreitz@redhat.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.