Patchwork [-V3,31/32] virtio-9p: Return proper errors from create paths.

login
register
mail settings
Submitter Aneesh Kumar K.V
Date March 25, 2010, 4:43 p.m.
Message ID <1269535420-31206-32-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/48583/
State New
Headers show

Comments

Aneesh Kumar K.V - March 25, 2010, 4:43 p.m.
From: Sripathi Kodi <sripathik@in.ibm.com>

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 <sripathik@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 hw/virtio-9p.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

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;
     }