From: Sripathi Kodi <sripathik@in.ibm.com>
To: qemu-devel@nongnu.org
Cc: aneesh.kumar@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH] virtio-9p: Return correct error from v9fs_remove
Date: Fri, 4 Jun 2010 10:08:55 +0530 [thread overview]
Message-ID: <20100604100855.126433f1@in.ibm.com> (raw)
In-Reply-To: <20100603153835.29381.79722.stgit@localhost.localdomain>
This patch got mangled last time. Resending.
virtio-9p: Return correct error from v9fs_remove
In v9fs_remove_post_remove() we currently ignore the error returned by
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 <sripathik@in.ibm.com>
---
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);
}
prev parent reply other threads:[~2010-06-04 4:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-03 15:38 [Qemu-devel] [PATCH] In v9fs_remove_post_remove() we currently ignore the error returned by Sripathi Kodi
2010-06-04 4:38 ` Sripathi Kodi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100604100855.126433f1@in.ibm.com \
--to=sripathik@in.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).