summaryrefslogtreecommitdiff
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-08-17 18:02:19 +0400
committerSteve French <smfrench@gmail.com>2012-08-19 22:30:18 -0500
commitea7b4887e7266b93fa0c203cc452a926a0fef4f0 (patch)
tree35a3b63e844b403077db71cdc374b53297ec2e02 /fs/cifs/dir.c
parent985e4ff016b5f3d95c12fe8073d1df89300dab3d (diff)
downloadlinux-3.10-ea7b4887e7266b93fa0c203cc452a926a0fef4f0.tar.gz
linux-3.10-ea7b4887e7266b93fa0c203cc452a926a0fef4f0.tar.bz2
linux-3.10-ea7b4887e7266b93fa0c203cc452a926a0fef4f0.zip
CIFS: Fix cifs_do_create error hadnling
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 <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index cbe709ad666..781025be48b 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);