]> Git Repo - qemu.git/commitdiff
block: fix return code for partial write for Linux AIO
authorDenis V. Lunev <[email protected]>
Thu, 23 Jun 2016 11:37:16 +0000 (14:37 +0300)
committerKevin Wolf <[email protected]>
Tue, 5 Jul 2016 14:46:26 +0000 (16:46 +0200)
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 <[email protected]>
CC: Pavel Borzenkov <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Max Reitz <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/linux-aio.c

index e468960146ba94586d43081fed742c6542364c0d..7df8651581229adaf5cd0ec111bb3b65f730bc46 100644 (file)
@@ -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;
             }
         }
     }
This page took 0.024016 seconds and 4 git commands to generate.