From patchwork Thu Mar 25 16:43:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [-V3,31/32] virtio-9p: Return proper errors from create paths. Date: Thu, 25 Mar 2010 06:43:39 -0000 From: Aneesh Kumar K.V X-Patchwork-Id: 48583 Message-Id: <1269535420-31206-32-git-send-email-aneesh.kumar@linux.vnet.ibm.com> To: qemu-devel@nongnu.org Cc: ericvh@gmail.com, aliguori@us.ibm.com, Sripathi Kodi , "Aneesh Kumar K.V" From: Sripathi Kodi Create first calls lstat to see if the file exists. Errors from lstat are not handled properly. For most of the errors we return EEXIST. We should return the errno instead. Signed-off-by: Sripathi Kodi Signed-off-by: Aneesh Kumar K.V --- hw/virtio-9p.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 5ccaeac..1b791ca 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -1644,7 +1644,7 @@ static void v9fs_create_post_lstat(V9fsState *s, V9fsCreateState *vs, int err) { if ( err == 0 || errno != ENOENT) { - err = -EEXIST; + err = -errno; goto out; }