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]>
qemu_iovec_memset(laiocb->qiov, ret, 0,
laiocb->qiov->size - ret);
} else {
- ret = -EINVAL;
+ ret = -ENOSPC;
}
}
}