From patchwork Fri Aug 17 14:43:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1338931 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AC464DF266 for ; Fri, 17 Aug 2012 14:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758070Ab2HQOol (ORCPT ); Fri, 17 Aug 2012 10:44:41 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]:48742 "EHLO mail-lpp01m010-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758066Ab2HQOok (ORCPT ); Fri, 17 Aug 2012 10:44:40 -0400 Received: by lagy9 with SMTP id y9so2142008lag.19 for ; Fri, 17 Aug 2012 07:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer; bh=m5UwKq2Y8nQKIqEmrTa7XkQx5lay1UM7ayEH+k5BjAI=; b=yxcS0ajsr+kZ6izn2RH+bZzGqjPAVmlMt5LoTAgULZu4mGB+vgKEiEu5iBddjmhI1P Nmu+n30Hs2BkrRYSscvqtj0tLELboogUfz8Ui7OExKSFm2S9hABkvBajBqfs9wZusS0E tWKmviV6GPhWWaC5s2xX6IRdTiAGOF9TCZ7qa2YaGj2S61D1tylM1Vke1tgFBpzhbOrI q8Q/uXFL+G7nsL0AD1wtuquJ1rTRa+fhnKeAevs9Ya2MixLZy9E2nMpzeciB5rNR74C4 ockEdra5PIT710Ko8R4ywNNlRpIHMon3EKBR2bgTi14jYWqMrcWj7B02ColHCQCe5M00 GJeA== Received: by 10.112.24.196 with SMTP id w4mr2380278lbf.37.1345214678787; Fri, 17 Aug 2012 07:44:38 -0700 (PDT) Received: from localhost.localdomain ([178.45.222.197]) by mx.google.com with ESMTPS id sm7sm7374976lab.5.2012.08.17.07.44.37 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Aug 2012 07:44:37 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH] CIFS: Fix cifs_do_create error hadnling Date: Fri, 17 Aug 2012 18:43:48 +0400 Message-Id: <1345214629-11059-1-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.7.1 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Commit d2c127197dfc0b2bae62a52e1e0d3e3ff493919e caused a regression in cifs_do_create error handling. Fix this by closing a file handle in the case of a get_inode_info(_unix) error. Also remove unnecessary checks for newinode being NULL. Signed-off-by: Pavel Shilovsky --- fs/cifs/dir.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index cbe709a..781025b 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -356,19 +356,12 @@ cifs_create_get_file_info: cifs_create_set_dentry: if (rc != 0) { cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); + CIFSSMBClose(xid, tcon, *fileHandle); goto out; } d_drop(direntry); d_add(direntry, newinode); - /* ENOENT for create? How weird... */ - rc = -ENOENT; - if (!newinode) { - CIFSSMBClose(xid, tcon, *fileHandle); - goto out; - } - rc = 0; - out: kfree(buf); kfree(full_path);