From patchwork Sun Mar 13 05:05:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 630921 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2D55t6Z020775 for ; Sun, 13 Mar 2011 05:05:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750745Ab1CMFFw (ORCPT ); Sun, 13 Mar 2011 00:05:52 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:36046 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750706Ab1CMFFw (ORCPT ); Sun, 13 Mar 2011 00:05:52 -0500 Received: by iyb26 with SMTP id 26so3928504iyb.19 for ; Sat, 12 Mar 2011 21:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to:cc :content-type; bh=EdPCels3TuzLm8ee3Ld7a4z97CtLTw2cyb2QStlN7EU=; b=FXVK7Ebl62wIOH6lqmP/pTtrgLHg8IYZBdkTJpybKFJJ6m1P5Zw25p8C96uQ2BWMBJ i1zFhLKKvBrwQY8Qi+PVOauXnY9vjEOHiPghKmcDY7/KggCwbAZaQr4oCK+QZSuzvMGt Mg1m40u3sGW2+1pT3MVuuMU6Ju4/LPy8pu8oI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=NmaU+rb7k7u8U1BZMLzw3JxUgncSxzumDEHVLOu1T6pQqDCi2ESv3qwOaPvme82vw2 aUWmPmCEzCuzVsdey7QrHVt20R10GYTFA9ySzpLm+AapMgSuvXTzD4bj4UpS5MGT1ENP SEi06f7LANis89JfBjitsL53key8GHWFws2YI= MIME-Version: 1.0 Received: by 10.42.168.6 with SMTP id u6mr4908030icy.46.1299992751406; Sat, 12 Mar 2011 21:05:51 -0800 (PST) Received: by 10.42.148.195 with HTTP; Sat, 12 Mar 2011 21:05:51 -0800 (PST) Date: Sat, 12 Mar 2011 23:05:51 -0600 Message-ID: Subject: [CIFS] various endian fixes to cifs From: Steve French To: linux-cifs@vger.kernel.org Cc: Suresh Jayaraman , Jeff Layton , Shirish Pargaonkar , "Stefan (metze) Metzmacher" Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 13 Mar 2011 05:05:56 +0000 (UTC) diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c index 29b20ae..dd8584d 100644 --- a/fs/cifs/cache.c +++ b/fs/cifs/cache.c @@ -50,7 +50,7 @@ void cifs_fscache_unregister(void) */ struct cifs_server_key { uint16_t family; /* address family */ - uint16_t port; /* IP port */ + __be16 port; /* IP port */ union { struct in_addr ipv4_addr; struct in6_addr ipv6_addr; diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 6488a52..3c72e66 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -725,7 +725,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server) return rc; /* set up echo request */ - smb->hdr.Tid = cpu_to_le16(0xffff); + smb->hdr.Tid = 0xffff; smb->hdr.WordCount = 1; put_unaligned_le16(1, &smb->EchoCount); put_bcc_le(1, &smb->hdr); @@ -1880,10 +1880,10 @@ CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon, __constant_cpu_to_le16(CIFS_WRLCK)) pLockData->fl_type = F_WRLCK; - pLockData->fl_start = parm_data->start; - pLockData->fl_end = parm_data->start + - parm_data->length - 1; - pLockData->fl_pid = parm_data->pid; + pLockData->fl_start = le64_to_cpu(parm_data->start); + pLockData->fl_end = pLockData->fl_start + + le64_to_cpu(parm_data->length) - 1; + pLockData->fl_pid = le32_to_cpu(parm_data->pid); } } diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 2904baa..3a097b6 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -239,7 +239,7 @@ CIFSQueryMFSymLink(const int xid, struct cifs_tcon *tcon, if (rc != 0) return rc; - if (file_info.EndOfFile != CIFS_MF_SYMLINK_FILE_SIZE) { + if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) { CIFSSMBClose(xid, tcon, netfid); /* it's not a symlink */ return -EINVAL; @@ -316,7 +316,7 @@ CIFSCheckMFSymlink(struct cifs_fattr *fattr, if (rc != 0) goto out; - if (file_info.EndOfFile != CIFS_MF_SYMLINK_FILE_SIZE) { + if (file_info.EndOfFile != cpu_to_le64(CIFS_MF_SYMLINK_FILE_SIZE)) { CIFSSMBClose(xid, pTcon, netfid); /* it's not a symlink */ goto out; diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 16831c7..e982890 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -404,8 +404,8 @@ int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, /* BB spec says that if AvId field of MsvAvTimestamp is populated then we must set the MIC field of the AUTHENTICATE_MESSAGE */ ses->ntlmssp->server_flags = le32_to_cpu(pblob->NegotiateFlags); - tioffset = cpu_to_le16(pblob->TargetInfoArray.BufferOffset); - tilen = cpu_to_le16(pblob->TargetInfoArray.Length); + tioffset = le32_to_cpu(pblob->TargetInfoArray.BufferOffset); + tilen = le16_to_cpu(pblob->TargetInfoArray.Length); if (tilen) { ses->auth_key.response = kmalloc(tilen, GFP_KERNEL); if (!ses->auth_key.response) {