From patchwork Thu Mar 25 16:43:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 48583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C4A81B7CF1 for ; Fri, 26 Mar 2010 05:34:44 +1100 (EST) Received: from localhost ([127.0.0.1]:57866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NurtB-0003c0-G4 for incoming@patchwork.ozlabs.org; Thu, 25 Mar 2010 14:34:41 -0400 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 Received: from localhost.localdomain ([9.77.125.24]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o2PGhgP6030935; Fri, 26 Mar 2010 03:44:49 +1100 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Thu, 25 Mar 2010 22:13:39 +0530 Message-Id: <1269535420-31206-32-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.2.323.g0d092 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: ericvh@gmail.com, aliguori@us.ibm.com, Sripathi Kodi , "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH -V3 31/32] virtio-9p: Return proper errors from create paths. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }