diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 15 |
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) | |||
784 | FILE_BASIC_INFO *info_buf; | 784 | FILE_BASIC_INFO *info_buf; |
785 | 785 | ||
786 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, | 786 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, |
787 | DELETE|FILE_WRITE_ATTRIBUTES, | 787 | DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, |
788 | CREATE_NOT_DIR|CREATE_DELETE_ON_CLOSE, | ||
789 | &netfid, &oplock, NULL, cifs_sb->local_nls, | 788 | &netfid, &oplock, NULL, cifs_sb->local_nls, |
790 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 789 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
791 | if (rc != 0) | 790 | if (rc != 0) |
@@ -810,17 +809,23 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid) | |||
810 | goto out_close; | 809 | goto out_close; |
811 | cifsInode->cifsAttrs = dosattr; | 810 | cifsInode->cifsAttrs = dosattr; |
812 | 811 | ||
813 | /* silly-rename the file */ | 812 | /* rename the file */ |
814 | CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, | 813 | rc = CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, |
815 | cifs_sb->mnt_cifs_flags & | 814 | cifs_sb->mnt_cifs_flags & |
816 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 815 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
816 | if (rc != 0) | ||
817 | goto out; | ||
817 | 818 | ||
818 | /* set DELETE_ON_CLOSE */ | 819 | /* set DELETE_ON_CLOSE */ |
819 | rc = CIFSSMBSetFileDisposition(xid, tcon, true, netfid, current->tgid); | 820 | rc = CIFSSMBSetFileDisposition(xid, tcon, true, netfid, current->tgid); |
820 | 821 | ||
821 | /* | 822 | /* |
822 | * some samba versions return -ENOENT when we try to set the file | 823 | * some samba versions return -ENOENT when we try to set the file |
823 | * disposition here. Likely a samba bug, but work around it for now | 824 | * disposition here. Likely a samba bug, but work around it for now. |
825 | * This means that some cifsXXX files may hang around after they | ||
826 | * shouldn't. | ||
827 | * | ||
828 | * BB: remove this once fixed samba servers are in the field | ||
824 | */ | 829 | */ |
825 | if (rc == -ENOENT) | 830 | if (rc == -ENOENT) |
826 | rc = 0; | 831 | rc = 0; |