qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] In v9fs_remove_post_remove() we currently ignore th


From: Sripathi Kodi
Subject: [Qemu-devel] [PATCH] In v9fs_remove_post_remove() we currently ignore the error returned by
Date: Thu, 03 Jun 2010 21:08:35 +0530
User-agent: StGIT/0.14.3

the previous call to remove() and return an error only if freeing the
fid fails. However, the client expects to see the error from remove().
Currently the client falsely thinks that the remove call has always
succeeded. For example, doing rmdir on a non-empty directory does
not return ENOTEMPTY.

With this patch we ignore the error from free_fid(). The client cannot
use this error value anyway.

Signed-off-by: Sripathi Kodi <address@hidden>
---

 hw/virtio-9p.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c
index e5d0112..999c0d5 100644
--- a/hw/virtio-9p.c
+++ b/hw/virtio-9p.c
@@ -1943,14 +1943,15 @@ typedef struct V9fsRemoveState {
 static void v9fs_remove_post_remove(V9fsState *s, V9fsRemoveState *vs,
                                                                 int err)
 {
-    /* For TREMOVE we need to clunk the fid even on failed remove */
-    err = free_fid(s, vs->fidp->fid);
     if (err < 0) {
-        goto out;
+        err = -errno;
+    } else {
+        err = vs->offset;
     }
 
-    err = vs->offset;
-out:
+    /* For TREMOVE we need to clunk the fid even on failed remove */
+    free_fid(s, vs->fidp->fid);
+
     complete_pdu(s, vs->pdu, err);
     qemu_free(vs);
 }




reply via email to

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