qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH] block/nfs: fix calculation of allo


From: Max Reitz
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] block/nfs: fix calculation of allocated file size
Date: Fri, 21 Aug 2015 09:33:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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: address@hidden
Signed-off-by: Peter Lieven <address@hidden>
---
  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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]