aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-04-01 01:22:00 -0400
committerSteve French <sfrench@us.ibm.com>2009-04-16 21:26:48 -0400
commit85a6dac54a7e28112488b02523202985edc7e639 (patch)
tree141a35196516dc428fe2891b7c7da02d0133ecad /fs/cifs/inode.c
parent74496d365ad171d11f21da4a8be71c945f6ec825 (diff)
[CIFS] Endian convert UniqueId when reporting inode numbers from server files
Jeff made a good point that we should endian convert the UniqueId when we use it to set i_ino Even though this value is opaque to the client, when comparing the inode numbers of the same server file from two different clients (one big endian, one little endian) or when we compare a big endian client's view of i_ino with what the server thinks - we should get the same value Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 89063f1eb55b..fceebee39f27 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -276,7 +276,8 @@ int cifs_get_inode_info_unix(struct inode **pinode,
276 276
277 /* get new inode */ 277 /* get new inode */
278 if (*pinode == NULL) { 278 if (*pinode == NULL) {
279 *pinode = cifs_new_inode(sb, &find_data.UniqueId); 279 __u64 unique_id = le64_to_cpu(find_data.UniqueId);
280 *pinode = cifs_new_inode(sb, &unique_id);
280 if (*pinode == NULL) { 281 if (*pinode == NULL) {
281 rc = -ENOMEM; 282 rc = -ENOMEM;
282 goto cgiiu_exit; 283 goto cgiiu_exit;
@@ -1138,6 +1139,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
1138 cFYI(1, ("posix mkdir returned 0x%x", rc)); 1139 cFYI(1, ("posix mkdir returned 0x%x", rc));
1139 d_drop(direntry); 1140 d_drop(direntry);
1140 } else { 1141 } else {
1142 __u64 unique_id;
1141 if (pInfo->Type == cpu_to_le32(-1)) { 1143 if (pInfo->Type == cpu_to_le32(-1)) {
1142 /* no return info, go query for it */ 1144 /* no return info, go query for it */
1143 kfree(pInfo); 1145 kfree(pInfo);
@@ -1151,8 +1153,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
1151 else 1153 else
1152 direntry->d_op = &cifs_dentry_ops; 1154 direntry->d_op = &cifs_dentry_ops;
1153 1155
1154 newinode = cifs_new_inode(inode->i_sb, 1156 unique_id = le64_to_cpu(pInfo->UniqueId);
1155 &pInfo->UniqueId); 1157 newinode = cifs_new_inode(inode->i_sb, &unique_id);
1156 if (newinode == NULL) { 1158 if (newinode == NULL) {
1157 kfree(pInfo); 1159 kfree(pInfo);
1158 goto mkdir_get_info; 1160 goto mkdir_get_info;