diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 35d54bb0869a..dffe295825f4 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -885,10 +885,14 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry, | |||
885 | kmalloc(2 * sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); | 885 | kmalloc(2 * sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); |
886 | if (info_buf_source != NULL) { | 886 | if (info_buf_source != NULL) { |
887 | info_buf_target = info_buf_source + 1; | 887 | info_buf_target = info_buf_source + 1; |
888 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName, | 888 | if (pTcon->ses->capabilities & CAP_UNIX) |
889 | info_buf_source, cifs_sb_source->local_nls, | 889 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName, |
890 | cifs_sb_source->mnt_cifs_flags & | 890 | info_buf_source, |
891 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 891 | cifs_sb_source->local_nls, |
892 | cifs_sb_source->mnt_cifs_flags & | ||
893 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
894 | /* else rc is still EEXIST so will fall through to | ||
895 | unlink the target and retry rename */ | ||
892 | if (rc == 0) { | 896 | if (rc == 0) { |
893 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, toName, | 897 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, toName, |
894 | info_buf_target, | 898 | info_buf_target, |
@@ -937,7 +941,7 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry, | |||
937 | cifs_sb_source->mnt_cifs_flags & | 941 | cifs_sb_source->mnt_cifs_flags & |
938 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 942 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
939 | if (rc==0) { | 943 | if (rc==0) { |
940 | CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName, | 944 | rc = CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName, |
941 | cifs_sb_source->local_nls, | 945 | cifs_sb_source->local_nls, |
942 | cifs_sb_source->mnt_cifs_flags & | 946 | cifs_sb_source->mnt_cifs_flags & |
943 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 947 | CIFS_MOUNT_MAP_SPECIAL_CHR); |