Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f2376adfb57d95973b64ecdf016937f436b9bf0
Commit:     8f2376adfb57d95973b64ecdf016937f436b9bf0
Parent:     516897a208bc1423d561ce2ccce0624c3b652275
Author:     Cyril Gorcunov <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 14 17:58:43 2007 +0000
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Sun Oct 14 17:58:43 2007 +0000

    [CIFS] Fix endian conversion problem in posix mkdir
    
    Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]>
    Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/CHANGES       |    3 ++-
 fs/cifs/cifsacl.h     |    4 ++--
 fs/cifs/cifsencrypt.c |    5 +++--
 fs/cifs/cifssmb.c     |    8 ++++----
 fs/cifs/inode.c       |    3 ++-
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 13071fa..70c90c0 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -9,7 +9,8 @@ ability to mount to IPC$ share (which allows CIFS named pipes 
to be
 opened, read and written as if they were files).  When 1st tree
 connect fails (e.g. due to signing negotiation failure) fix
 leak that causes cifsd not to stop and rmmod to fail to cleanup
-cifs_request_buffers pool.
+cifs_request_buffers pool. Fix problem with POSIX Open/Mkdir on
+bigendian architectures.
 
 Version 1.50
 ------------
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
index 1b11564..0362cd1 100644
--- a/fs/cifs/cifsacl.h
+++ b/fs/cifs/cifsacl.h
@@ -51,8 +51,8 @@ struct cifs_acl {
 struct cifs_ntace { /* first part of ACE which contains perms */
        __u8 type;
        __u8 flags;
-       __u16 size;
-       __u32 access_req;
+       __le16 size;
+       __le32 access_req;
 } __attribute__((packed));
 
 struct cifs_ace { /* last part of ACE which includes user info */
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 3627229..632070b 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -345,7 +345,7 @@ static int calc_ntlmv2_hash(struct cifsSesInfo *ses,
        user = kmalloc(2 + (len * 2), GFP_KERNEL);
        if (user == NULL)
                goto calc_exit_2;
-       len = cifs_strtoUCS(user, ses->userName, len, nls_cp);
+       len = cifs_strtoUCS((__le16 *)user, ses->userName, len, nls_cp);
        UniStrupr(user);
        hmac_md5_update((char *)user, 2*len, pctxt);
 
@@ -356,7 +356,8 @@ static int calc_ntlmv2_hash(struct cifsSesInfo *ses,
                domain = kmalloc(2 + (len * 2), GFP_KERNEL);
                if (domain == NULL)
                        goto calc_exit_1;
-               len = cifs_strtoUCS(domain, ses->domainName, len, nls_cp);
+               len = cifs_strtoUCS((__le16 *)domain, ses->domainName, len,
+                                       nls_cp);
                /* the following line was removed since it didn't work well
                   with lower cased domain name that passed as an option.
                   Maybe converting the domain name earlier makes sense */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index eff3226..b179836 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1069,7 +1069,7 @@ PsxCreat:
                                InformationLevel) - 4;
        offset = param_offset + params;
        pdata = (OPEN_PSX_REQ *)(((char *)&pSMB->hdr.Protocol) + offset);
-       pdata->Level = SMB_QUERY_FILE_UNIX_BASIC;
+       pdata->Level = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC);
        pdata->Permissions = cpu_to_le64(mode);
        pdata->PosixOpenFlags = cpu_to_le32(posix_flags);
        pdata->OpenFlags =  cpu_to_le32(*pOplock);
@@ -1115,8 +1115,8 @@ PsxCreat:
        if (cpu_to_le32(FILE_CREATE) == psx_rsp->CreateAction)
                *pOplock |= CIFS_CREATE_ACTION;
        /* check to make sure response data is there */
-       if (psx_rsp->ReturnedLevel != SMB_QUERY_FILE_UNIX_BASIC) {
-               pRetData->Type = -1; /* unknown */
+       if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) {
+               pRetData->Type = cpu_to_le32(-1); /* unknown */
 #ifdef CONFIG_CIFS_DEBUG2
                cFYI(1, ("unknown type"));
 #endif
@@ -1124,7 +1124,7 @@ PsxCreat:
                if (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP)
                                        + sizeof(FILE_UNIX_BASIC_INFO)) {
                        cERROR(1, ("Open response data too small"));
-                       pRetData->Type = -1;
+                       pRetData->Type = cpu_to_le32(-1);
                        goto psx_create_err;
                }
                memcpy((char *) pRetData,
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index ece17ca..cc119b2 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -947,7 +947,8 @@ int cifs_mkdir(struct inode *inode, struct dentry 
*direntry, int mode)
                        d_drop(direntry);
                } else {
                        int obj_type;
-                       if (pInfo->Type == -1) /* no return info - go query */ {
+                       if (pInfo->Type == cpu_to_le32(-1)) {
+                               /* no return info, go query for it */
                                kfree(pInfo);
                                goto mkdir_get_info;
                        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to