From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuqBR-0007Ta-Ig for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:45:25 -0400 Received: from [140.186.70.92] (port=50923 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuqB9-0007LK-OQ for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:45:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuqAw-0005H7-3Q for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:45:07 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:51629) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuqAv-0005Gh-JF for qemu-devel@nongnu.org; Thu, 25 Mar 2010 12:44:54 -0400 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp07.au.ibm.com (8.14.3/8.13.1) with ESMTP id o2PGiqnQ031097 for ; Fri, 26 Mar 2010 03:44:52 +1100 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 o2PGcjdk1327300 for ; Fri, 26 Mar 2010 03:38:45 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2PGipw9031893 for ; Fri, 26 Mar 2010 03:44:51 +1100 From: "Aneesh Kumar K.V" Date: Thu, 25 Mar 2010 22:13:39 +0530 Message-Id: <1269535420-31206-32-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1269535420-31206-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V3 31/32] virtio-9p: Return proper errors from create paths. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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; } -- 1.7.0.2.323.g0d092