From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58513 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKCds-000629-Er for qemu-devel@nongnu.org; Thu, 03 Jun 2010 11:47:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKCVE-00011c-TX for qemu-devel@nongnu.org; Thu, 03 Jun 2010 11:38:41 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:52073) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKCVE-00011L-Bz for qemu-devel@nongnu.org; Thu, 03 Jun 2010 11:38:40 -0400 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp04.au.ibm.com (8.14.4/8.13.1) with ESMTP id o53FYU8c018527 for ; Fri, 4 Jun 2010 01:34:30 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o53FcbJ11577086 for ; Fri, 4 Jun 2010 01:38:37 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o53FcaRg026761 for ; Fri, 4 Jun 2010 01:38:37 +1000 From: Sripathi Kodi Date: Thu, 03 Jun 2010 21:08:35 +0530 Message-ID: <20100603153835.29381.79722.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] In v9fs_remove_post_remove() we currently ignore the error returned by List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aneesh.kumar@linux.vnet.ibm.com 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 --- 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); }