summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-10-16 19:27:12 -0400
committerSteve French <sfrench@us.ibm.com>2008-10-17 14:47:13 +0000
commitdd1db2dedc4f6ad736fbba5aa6ecfe6e7c8ee0f4 (patch)
tree5585ad01c207b5cf0e45857255bceb4e1efee3ce /fs/cifs
parent469ee614aaa367d9cde01cbdd2027212f56c6cc6 (diff)
downloadblackbird-obmc-linux-dd1db2dedc4f6ad736fbba5aa6ecfe6e7c8ee0f4.tar.gz
blackbird-obmc-linux-dd1db2dedc4f6ad736fbba5aa6ecfe6e7c8ee0f4.zip
cifs: don't use CREATE_DELETE_ON_CLOSE in cifs_rename_pending_delete
cifs: don't use CREATE_DELETE_ON_CLOSE in cifs_rename_pending_delete CREATE_DELETE_ON_CLOSE apparently has different semantics than when you set the DELETE_ON_CLOSE bit after opening the file. Setting it in the open says "delete this file as soon as this filehandle is closed". That's not what we want for cifs_rename_pending_delete. Don't set this bit in the CreateFlags. Experimentation shows that setting this flag in the SET_FILE_INFO call has no effect. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/inode.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index a8c833345fc9..fe4f2ee97b6c 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -784,8 +784,7 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid)
FILE_BASIC_INFO *info_buf;
rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
- DELETE|FILE_WRITE_ATTRIBUTES,
- CREATE_NOT_DIR|CREATE_DELETE_ON_CLOSE,
+ DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR,
&netfid, &oplock, NULL, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc != 0)
@@ -810,17 +809,23 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid)
goto out_close;
cifsInode->cifsAttrs = dosattr;
- /* silly-rename the file */
- CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls,
+ /* rename the file */
+ rc = CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
+ if (rc != 0)
+ goto out;
/* set DELETE_ON_CLOSE */
rc = CIFSSMBSetFileDisposition(xid, tcon, true, netfid, current->tgid);
/*
* some samba versions return -ENOENT when we try to set the file
- * disposition here. Likely a samba bug, but work around it for now
+ * disposition here. Likely a samba bug, but work around it for now.
+ * This means that some cifsXXX files may hang around after they
+ * shouldn't.
+ *
+ * BB: remove this once fixed samba servers are in the field
*/
if (rc == -ENOENT)
rc = 0;
OpenPOWER on IntegriCloud