qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/1] block: fix return code for partial write fo


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 1/1] block: fix return code for partial write for Linux AIO
Date: Tue, 28 Jun 2016 14:21:20 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 06/23/2016 02:37 PM, Denis V. Lunev wrote:
Partial write most likely means that there is not space rather than
"something wrong happens". Thus it would be more natural to return
ENOSPC rather than EINVAL.

The problem actually happens with NBD server, which has reported EINVAL
rather then ENOSPC on the first error using its protocol, which makes
report to the user wrong.

Signed-off-by: Denis V. Lunev <address@hidden>
CC: Pavel Borzenkov <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Max Reitz <address@hidden>
---
  block/linux-aio.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/linux-aio.c b/block/linux-aio.c
index e468960..7df8651 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -87,7 +87,7 @@ static void qemu_laio_process_completion(struct qemu_laiocb 
*laiocb)
                  qemu_iovec_memset(laiocb->qiov, ret, 0,
                      laiocb->qiov->size - ret);
              } else {
-                ret = -EINVAL;
+                ret = -ENOSPC;
              }
          }
      }
ping



reply via email to

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