diff options
-rw-r--r-- | fs/cifs/inode.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 079f39a8dd3b..27e97d43c759 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -778,7 +778,8 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid) | |||
778 | FILE_BASIC_INFO *info_buf; | 778 | FILE_BASIC_INFO *info_buf; |
779 | 779 | ||
780 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, | 780 | rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, |
781 | DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, | 781 | DELETE|FILE_WRITE_ATTRIBUTES, |
782 | CREATE_NOT_DIR|CREATE_DELETE_ON_CLOSE, | ||
782 | &netfid, &oplock, NULL, cifs_sb->local_nls, | 783 | &netfid, &oplock, NULL, cifs_sb->local_nls, |
783 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 784 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
784 | if (rc != 0) | 785 | if (rc != 0) |
@@ -803,13 +804,20 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid) | |||
803 | goto out_close; | 804 | goto out_close; |
804 | 805 | ||
805 | /* silly-rename the file */ | 806 | /* silly-rename the file */ |
806 | rc = CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, | 807 | CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, |
807 | cifs_sb->mnt_cifs_flags & | 808 | cifs_sb->mnt_cifs_flags & |
808 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 809 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
809 | 810 | ||
810 | /* set DELETE_ON_CLOSE */ | 811 | /* set DELETE_ON_CLOSE */ |
811 | rc = CIFSSMBSetFileDisposition(xid, tcon, true, netfid, current->tgid); | 812 | rc = CIFSSMBSetFileDisposition(xid, tcon, true, netfid, current->tgid); |
812 | 813 | ||
814 | /* | ||
815 | * some samba versions return -ENOENT when we try to set the file | ||
816 | * disposition here. Likely a samba bug, but work around it for now | ||
817 | */ | ||
818 | if (rc == -ENOENT) | ||
819 | rc = 0; | ||
820 | |||
813 | out_close: | 821 | out_close: |
814 | CIFSSMBClose(xid, tcon, netfid); | 822 | CIFSSMBClose(xid, tcon, netfid); |
815 | out: | 823 | out: |