aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-11-01 22:45:24 -0500
committerSteve French <sfrench@us.ibm.com>2006-11-01 22:45:24 -0500
commit8e87d4dc159148f04f515bc072df22a2c089e7f2 (patch)
tree2c9bb5abd706b3f9c710ab400d77c7ab91ae5b06 /fs/cifs/inode.c
parent4b952a9b0877dbe8f0f69b2747abe79e3bbd2865 (diff)
[CIFS] report rename failure when target file is locked by Windows
Fixes Samba bugzilla bug # 4182 Rename by handle failures (retry after rename by path) were not being returned back. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c14
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);