diff options
author | Jeff Layton <jlayton@redhat.com> | 2008-10-06 17:54:41 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-10-06 17:54:41 -0400 |
commit | 6b37faa175311128dc920aaa57a5f7fab85537d7 (patch) | |
tree | b01a801464cfbb0749efa712bea857fe4a11b915 /fs/cifs | |
parent | dfd15c46a6c2cafb006183c0c14f07e59eee4ac0 (diff) |
[CIFS] fix some settings of cifsAttrs after calling SetFileInfo and SetPathInfo
We only need to set them when we call SetFileInfo or SetPathInfo
directly, and as soon as possible after then. We had one place setting
it where it didn't need to be, and another place where it was missing.
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.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index db091c516c2a..e387ed3f9446 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -729,7 +729,10 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, | |||
729 | &info_buf, cifs_sb->local_nls, | 729 | &info_buf, cifs_sb->local_nls, |
730 | cifs_sb->mnt_cifs_flags & | 730 | cifs_sb->mnt_cifs_flags & |
731 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 731 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
732 | if (rc != -EOPNOTSUPP && rc != -EINVAL) | 732 | if (rc == 0) { |
733 | cifsInode->cifsAttrs = dosattr; | ||
734 | goto out; | ||
735 | } else if (rc != -EOPNOTSUPP && rc != -EINVAL) | ||
733 | goto out; | 736 | goto out; |
734 | } | 737 | } |
735 | 738 | ||
@@ -805,6 +808,7 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid) | |||
805 | kfree(info_buf); | 808 | kfree(info_buf); |
806 | if (rc != 0) | 809 | if (rc != 0) |
807 | goto out_close; | 810 | goto out_close; |
811 | cifsInode->cifsAttrs = dosattr; | ||
808 | 812 | ||
809 | /* silly-rename the file */ | 813 | /* silly-rename the file */ |
810 | CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, | 814 | CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, |
@@ -905,7 +909,6 @@ psx_del_no_retry: | |||
905 | if (rc == 0) | 909 | if (rc == 0) |
906 | drop_nlink(inode); | 910 | drop_nlink(inode); |
907 | } | 911 | } |
908 | cifsInode->cifsAttrs = dosattr; | ||
909 | } | 912 | } |
910 | out_reval: | 913 | out_reval: |
911 | if (inode) { | 914 | if (inode) { |
@@ -963,7 +966,7 @@ static void posix_fill_in_inode(struct inode *tmp_inode, | |||
963 | 966 | ||
964 | int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | 967 | int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) |
965 | { | 968 | { |
966 | int rc = 0; | 969 | int rc = 0, tmprc; |
967 | int xid; | 970 | int xid; |
968 | struct cifs_sb_info *cifs_sb; | 971 | struct cifs_sb_info *cifs_sb; |
969 | struct cifsTconInfo *pTcon; | 972 | struct cifsTconInfo *pTcon; |
@@ -1025,6 +1028,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
1025 | kfree(pInfo); | 1028 | kfree(pInfo); |
1026 | goto mkdir_get_info; | 1029 | goto mkdir_get_info; |
1027 | } | 1030 | } |
1031 | |||
1028 | /* Is an i_ino of zero legal? */ | 1032 | /* Is an i_ino of zero legal? */ |
1029 | /* Are there sanity checks we can use to ensure that | 1033 | /* Are there sanity checks we can use to ensure that |
1030 | the server is really filling in that field? */ | 1034 | the server is really filling in that field? */ |
@@ -1113,12 +1117,20 @@ mkdir_get_info: | |||
1113 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && | 1117 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && |
1114 | (mode & S_IWUGO) == 0) { | 1118 | (mode & S_IWUGO) == 0) { |
1115 | FILE_BASIC_INFO pInfo; | 1119 | FILE_BASIC_INFO pInfo; |
1120 | struct cifsInodeInfo *cifsInode; | ||
1121 | u32 dosattrs; | ||
1122 | |||
1116 | memset(&pInfo, 0, sizeof(pInfo)); | 1123 | memset(&pInfo, 0, sizeof(pInfo)); |
1117 | pInfo.Attributes = cpu_to_le32(ATTR_READONLY); | 1124 | cifsInode = CIFS_I(newinode); |
1118 | CIFSSMBSetPathInfo(xid, pTcon, full_path, | 1125 | dosattrs = cifsInode->cifsAttrs|ATTR_READONLY; |
1119 | &pInfo, cifs_sb->local_nls, | 1126 | pInfo.Attributes = cpu_to_le32(dosattrs); |
1127 | tmprc = CIFSSMBSetPathInfo(xid, pTcon, | ||
1128 | full_path, &pInfo, | ||
1129 | cifs_sb->local_nls, | ||
1120 | cifs_sb->mnt_cifs_flags & | 1130 | cifs_sb->mnt_cifs_flags & |
1121 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 1131 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
1132 | if (tmprc == 0) | ||
1133 | cifsInode->cifsAttrs = dosattrs; | ||
1122 | } | 1134 | } |
1123 | if (direntry->d_inode) { | 1135 | if (direntry->d_inode) { |
1124 | if (cifs_sb->mnt_cifs_flags & | 1136 | if (cifs_sb->mnt_cifs_flags & |