diff options
author | Steve French <sfrench@us.ibm.com> | 2009-04-01 05:22:00 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-04-17 01:26:48 +0000 |
commit | 85a6dac54a7e28112488b02523202985edc7e639 (patch) | |
tree | 141a35196516dc428fe2891b7c7da02d0133ecad /fs/cifs/inode.c | |
parent | 74496d365ad171d11f21da4a8be71c945f6ec825 (diff) | |
download | linux-85a6dac54a7e28112488b02523202985edc7e639.tar.gz linux-85a6dac54a7e28112488b02523202985edc7e639.tar.bz2 linux-85a6dac54a7e28112488b02523202985edc7e639.zip |
[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.c | 8 |
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, /* get new inode */ if (*pinode == NULL) { - *pinode = cifs_new_inode(sb, &find_data.UniqueId); + __u64 unique_id = le64_to_cpu(find_data.UniqueId); + *pinode = cifs_new_inode(sb, &unique_id); if (*pinode == NULL) { rc = -ENOMEM; goto cgiiu_exit; @@ -1138,6 +1139,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) cFYI(1, ("posix mkdir returned 0x%x", rc)); d_drop(direntry); } else { + __u64 unique_id; if (pInfo->Type == cpu_to_le32(-1)) { /* no return info, go query for it */ kfree(pInfo); @@ -1151,8 +1153,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) else direntry->d_op = &cifs_dentry_ops; - newinode = cifs_new_inode(inode->i_sb, - &pInfo->UniqueId); + unique_id = le64_to_cpu(pInfo->UniqueId); + newinode = cifs_new_inode(inode->i_sb, &unique_id); if (newinode == NULL) { kfree(pInfo); goto mkdir_get_info; |