[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 10/10] block/nfs: fix nfs_client_open for filesize gr
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 10/10] block/nfs: fix nfs_client_open for filesize greater than 1TB |
Date: |
Wed, 29 Nov 2017 16:26:28 +0100 |
From: Peter Lieven <address@hidden>
DIV_ROUND_UP(st.st_size, BDRV_SECTOR_SIZE) was overflowing ret (int) if
st.st_size is greater than 1TB.
Cc: address@hidden
Signed-off-by: Peter Lieven <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/nfs.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block/nfs.c b/block/nfs.c
index 337fcd9c84..effc8719b5 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -1,7 +1,7 @@
/*
* QEMU Block driver for native access to files on NFS shares
*
- * Copyright (c) 2014-2016 Peter Lieven <address@hidden>
+ * Copyright (c) 2014-2017 Peter Lieven <address@hidden>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
deal
@@ -496,7 +496,7 @@ out:
static int64_t nfs_client_open(NFSClient *client, QDict *options,
int flags, int open_flags, Error **errp)
{
- int ret = -EINVAL;
+ int64_t ret = -EINVAL;
QemuOpts *opts = NULL;
Error *local_err = NULL;
struct stat st;
@@ -686,8 +686,7 @@ static QemuOptsList nfs_create_opts = {
static int nfs_file_create(const char *url, QemuOpts *opts, Error **errp)
{
- int ret = 0;
- int64_t total_size = 0;
+ int64_t ret, total_size;
NFSClient *client = g_new0(NFSClient, 1);
QDict *options = NULL;
--
2.13.6
- [Qemu-block] [PULL 00/10] Block layer fixes for 2.11.0-rc3, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 01/10] iotests: fix 075 and 078, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 03/10] qemu-options: Mention locking option of file driver, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 05/10] blockjob: Remove the job from the list earlier in block_job_unref(), Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 04/10] QAPI & interop: Clarify events emitted by 'block-job-cancel', Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 02/10] docs: Add image locking subsection, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 06/10] block: Expect graph changes in bdrv_parent_drained_begin/end, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 07/10] blockjob: remove clock argument from block_job_sleep_ns, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 08/10] blockjob: introduce block_job_do_yield, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 09/10] blockjob: reimplement block_job_sleep_ns to allow cancellation, Kevin Wolf, 2017/11/29
- [Qemu-block] [PULL 10/10] block/nfs: fix nfs_client_open for filesize greater than 1TB,
Kevin Wolf <=
- Re: [Qemu-block] [PULL 00/10] Block layer fixes for 2.11.0-rc3, Peter Maydell, 2017/11/29