aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2011-04-29 01:40:20 -0400
committerSteve French <sfrench@us.ibm.com>2011-05-19 10:10:51 -0400
commitbe8e3b0044a68e1f1002c432f6b40d290cf0701d (patch)
tree41f6a5e2ccf4bf03eb722030563490bbe46f0644 /fs/cifs/cifssmb.c
parent9409ae58e0759d010b347e7b19ebc90ab5d4b98f (diff)
consistently use smb_buf_length as be32 for cifs (try 3)
There is one big endian field in the cifs protocol, the RFC1001 length, which cifs code (unlike in the smb2 code) had been handling as u32 until the last possible moment, when it was converted to be32 (its native form) before sending on the wire. To remove the last sparse endian warning, and to make this consistent with the smb2 implementation (which always treats the fields in their native size and endianness), convert all uses of smb_buf_length to be32. This version incorporates Christoph's comment about using be32_add_cpu, and fixes a typo in the second version of the patch. Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c123
1 files changed, 65 insertions, 58 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 64dad47641a..88004094ebd 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -358,6 +358,13 @@ vt2_err:
358 return -EINVAL; 358 return -EINVAL;
359} 359}
360 360
361static inline void inc_rfc1001_len(void *pSMB, int count)
362{
363 struct smb_hdr *hdr = (struct smb_hdr *)pSMB;
364
365 be32_add_cpu(&hdr->smb_buf_length, count);
366}
367
361int 368int
362CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) 369CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
363{ 370{
@@ -410,7 +417,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
410 count += strlen(protocols[i].name) + 1; 417 count += strlen(protocols[i].name) + 1;
411 /* null at end of source and target buffers anyway */ 418 /* null at end of source and target buffers anyway */
412 } 419 }
413 pSMB->hdr.smb_buf_length += count; 420 inc_rfc1001_len(pSMB, count);
414 pSMB->ByteCount = cpu_to_le16(count); 421 pSMB->ByteCount = cpu_to_le16(count);
415 422
416 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, 423 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,
@@ -731,7 +738,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
731 put_unaligned_le16(1, &smb->EchoCount); 738 put_unaligned_le16(1, &smb->EchoCount);
732 put_bcc_le(1, &smb->hdr); 739 put_bcc_le(1, &smb->hdr);
733 smb->Data[0] = 'a'; 740 smb->Data[0] = 'a';
734 smb->hdr.smb_buf_length += 3; 741 inc_rfc1001_len(smb, 3);
735 742
736 rc = cifs_call_async(server, (struct smb_hdr *)smb, 743 rc = cifs_call_async(server, (struct smb_hdr *)smb,
737 cifs_echo_callback, server); 744 cifs_echo_callback, server);
@@ -849,7 +856,7 @@ PsxDelete:
849 pSMB->TotalParameterCount = pSMB->ParameterCount; 856 pSMB->TotalParameterCount = pSMB->ParameterCount;
850 pSMB->InformationLevel = cpu_to_le16(SMB_POSIX_UNLINK); 857 pSMB->InformationLevel = cpu_to_le16(SMB_POSIX_UNLINK);
851 pSMB->Reserved4 = 0; 858 pSMB->Reserved4 = 0;
852 pSMB->hdr.smb_buf_length += byte_count; 859 inc_rfc1001_len(pSMB, byte_count);
853 pSMB->ByteCount = cpu_to_le16(byte_count); 860 pSMB->ByteCount = cpu_to_le16(byte_count);
854 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 861 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
855 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 862 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -895,7 +902,7 @@ DelFileRetry:
895 pSMB->SearchAttributes = 902 pSMB->SearchAttributes =
896 cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM); 903 cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM);
897 pSMB->BufferFormat = 0x04; 904 pSMB->BufferFormat = 0x04;
898 pSMB->hdr.smb_buf_length += name_len + 1; 905 inc_rfc1001_len(pSMB, name_len + 1);
899 pSMB->ByteCount = cpu_to_le16(name_len + 1); 906 pSMB->ByteCount = cpu_to_le16(name_len + 1);
900 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 907 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
901 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 908 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -939,7 +946,7 @@ RmDirRetry:
939 } 946 }
940 947
941 pSMB->BufferFormat = 0x04; 948 pSMB->BufferFormat = 0x04;
942 pSMB->hdr.smb_buf_length += name_len + 1; 949 inc_rfc1001_len(pSMB, name_len + 1);
943 pSMB->ByteCount = cpu_to_le16(name_len + 1); 950 pSMB->ByteCount = cpu_to_le16(name_len + 1);
944 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 951 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
945 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 952 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -982,7 +989,7 @@ MkDirRetry:
982 } 989 }
983 990
984 pSMB->BufferFormat = 0x04; 991 pSMB->BufferFormat = 0x04;
985 pSMB->hdr.smb_buf_length += name_len + 1; 992 inc_rfc1001_len(pSMB, name_len + 1);
986 pSMB->ByteCount = cpu_to_le16(name_len + 1); 993 pSMB->ByteCount = cpu_to_le16(name_len + 1);
987 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 994 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
988 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 995 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -1060,7 +1067,7 @@ PsxCreat:
1060 pSMB->TotalParameterCount = pSMB->ParameterCount; 1067 pSMB->TotalParameterCount = pSMB->ParameterCount;
1061 pSMB->InformationLevel = cpu_to_le16(SMB_POSIX_OPEN); 1068 pSMB->InformationLevel = cpu_to_le16(SMB_POSIX_OPEN);
1062 pSMB->Reserved4 = 0; 1069 pSMB->Reserved4 = 0;
1063 pSMB->hdr.smb_buf_length += byte_count; 1070 inc_rfc1001_len(pSMB, byte_count);
1064 pSMB->ByteCount = cpu_to_le16(byte_count); 1071 pSMB->ByteCount = cpu_to_le16(byte_count);
1065 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1072 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1066 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1073 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -1225,7 +1232,7 @@ OldOpenRetry:
1225 pSMB->Sattr = cpu_to_le16(ATTR_HIDDEN | ATTR_SYSTEM | ATTR_DIRECTORY); 1232 pSMB->Sattr = cpu_to_le16(ATTR_HIDDEN | ATTR_SYSTEM | ATTR_DIRECTORY);
1226 pSMB->OpenFunction = cpu_to_le16(convert_disposition(openDisposition)); 1233 pSMB->OpenFunction = cpu_to_le16(convert_disposition(openDisposition));
1227 count += name_len; 1234 count += name_len;
1228 pSMB->hdr.smb_buf_length += count; 1235 inc_rfc1001_len(pSMB, count);
1229 1236
1230 pSMB->ByteCount = cpu_to_le16(count); 1237 pSMB->ByteCount = cpu_to_le16(count);
1231 /* long_op set to 1 to allow for oplock break timeouts */ 1238 /* long_op set to 1 to allow for oplock break timeouts */
@@ -1338,7 +1345,7 @@ openRetry:
1338 SECURITY_CONTEXT_TRACKING | SECURITY_EFFECTIVE_ONLY; 1345 SECURITY_CONTEXT_TRACKING | SECURITY_EFFECTIVE_ONLY;
1339 1346
1340 count += name_len; 1347 count += name_len;
1341 pSMB->hdr.smb_buf_length += count; 1348 inc_rfc1001_len(pSMB, count);
1342 1349
1343 pSMB->ByteCount = cpu_to_le16(count); 1350 pSMB->ByteCount = cpu_to_le16(count);
1344 /* long_op set to 1 to allow for oplock break timeouts */ 1351 /* long_op set to 1 to allow for oplock break timeouts */
@@ -1423,7 +1430,7 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, const int netfid,
1423 } 1430 }
1424 1431
1425 iov[0].iov_base = (char *)pSMB; 1432 iov[0].iov_base = (char *)pSMB;
1426 iov[0].iov_len = pSMB->hdr.smb_buf_length + 4; 1433 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4;
1427 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */, 1434 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */,
1428 &resp_buf_type, CIFS_LOG_ERROR); 1435 &resp_buf_type, CIFS_LOG_ERROR);
1429 cifs_stats_inc(&tcon->num_reads); 1436 cifs_stats_inc(&tcon->num_reads);
@@ -1557,7 +1564,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
1557 1564
1558 pSMB->DataLengthLow = cpu_to_le16(bytes_sent & 0xFFFF); 1565 pSMB->DataLengthLow = cpu_to_le16(bytes_sent & 0xFFFF);
1559 pSMB->DataLengthHigh = cpu_to_le16(bytes_sent >> 16); 1566 pSMB->DataLengthHigh = cpu_to_le16(bytes_sent >> 16);
1560 pSMB->hdr.smb_buf_length += byte_count; 1567 inc_rfc1001_len(pSMB, byte_count);
1561 1568
1562 if (wct == 14) 1569 if (wct == 14)
1563 pSMB->ByteCount = cpu_to_le16(byte_count); 1570 pSMB->ByteCount = cpu_to_le16(byte_count);
@@ -1641,11 +1648,12 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
1641 1648
1642 pSMB->DataLengthLow = cpu_to_le16(count & 0xFFFF); 1649 pSMB->DataLengthLow = cpu_to_le16(count & 0xFFFF);
1643 pSMB->DataLengthHigh = cpu_to_le16(count >> 16); 1650 pSMB->DataLengthHigh = cpu_to_le16(count >> 16);
1644 smb_hdr_len = pSMB->hdr.smb_buf_length + 1; /* hdr + 1 byte pad */ 1651 /* header + 1 byte pad */
1652 smb_hdr_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 1;
1645 if (wct == 14) 1653 if (wct == 14)
1646 pSMB->hdr.smb_buf_length += count+1; 1654 inc_rfc1001_len(pSMB, count + 1);
1647 else /* wct == 12 */ 1655 else /* wct == 12 */
1648 pSMB->hdr.smb_buf_length += count+5; /* smb data starts later */ 1656 inc_rfc1001_len(pSMB, count + 5); /* smb data starts later */
1649 if (wct == 14) 1657 if (wct == 14)
1650 pSMB->ByteCount = cpu_to_le16(count + 1); 1658 pSMB->ByteCount = cpu_to_le16(count + 1);
1651 else /* wct == 12 */ /* bigger pad, smaller smb hdr, keep offset ok */ { 1659 else /* wct == 12 */ /* bigger pad, smaller smb hdr, keep offset ok */ {
@@ -1745,7 +1753,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
1745 /* oplock break */ 1753 /* oplock break */
1746 count = 0; 1754 count = 0;
1747 } 1755 }
1748 pSMB->hdr.smb_buf_length += count; 1756 inc_rfc1001_len(pSMB, count);
1749 pSMB->ByteCount = cpu_to_le16(count); 1757 pSMB->ByteCount = cpu_to_le16(count);
1750 1758
1751 if (waitFlag) { 1759 if (waitFlag) {
@@ -1836,14 +1844,14 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
1836 pSMB->Fid = smb_file_id; 1844 pSMB->Fid = smb_file_id;
1837 pSMB->InformationLevel = cpu_to_le16(SMB_SET_POSIX_LOCK); 1845 pSMB->InformationLevel = cpu_to_le16(SMB_SET_POSIX_LOCK);
1838 pSMB->Reserved4 = 0; 1846 pSMB->Reserved4 = 0;
1839 pSMB->hdr.smb_buf_length += byte_count; 1847 inc_rfc1001_len(pSMB, byte_count);
1840 pSMB->ByteCount = cpu_to_le16(byte_count); 1848 pSMB->ByteCount = cpu_to_le16(byte_count);
1841 if (waitFlag) { 1849 if (waitFlag) {
1842 rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB, 1850 rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB,
1843 (struct smb_hdr *) pSMBr, &bytes_returned); 1851 (struct smb_hdr *) pSMBr, &bytes_returned);
1844 } else { 1852 } else {
1845 iov[0].iov_base = (char *)pSMB; 1853 iov[0].iov_base = (char *)pSMB;
1846 iov[0].iov_len = pSMB->hdr.smb_buf_length + 4; 1854 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4;
1847 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */, 1855 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */,
1848 &resp_buf_type, timeout); 1856 &resp_buf_type, timeout);
1849 pSMB = NULL; /* request buf already freed by SendReceive2. Do 1857 pSMB = NULL; /* request buf already freed by SendReceive2. Do
@@ -2009,7 +2017,7 @@ renameRetry:
2009 } 2017 }
2010 2018
2011 count = 1 /* 1st signature byte */ + name_len + name_len2; 2019 count = 1 /* 1st signature byte */ + name_len + name_len2;
2012 pSMB->hdr.smb_buf_length += count; 2020 inc_rfc1001_len(pSMB, count);
2013 pSMB->ByteCount = cpu_to_le16(count); 2021 pSMB->ByteCount = cpu_to_le16(count);
2014 2022
2015 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2023 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -2089,7 +2097,7 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon,
2089 pSMB->InformationLevel = 2097 pSMB->InformationLevel =
2090 cpu_to_le16(SMB_SET_FILE_RENAME_INFORMATION); 2098 cpu_to_le16(SMB_SET_FILE_RENAME_INFORMATION);
2091 pSMB->Reserved4 = 0; 2099 pSMB->Reserved4 = 0;
2092 pSMB->hdr.smb_buf_length += byte_count; 2100 inc_rfc1001_len(pSMB, byte_count);
2093 pSMB->ByteCount = cpu_to_le16(byte_count); 2101 pSMB->ByteCount = cpu_to_le16(byte_count);
2094 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB, 2102 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB,
2095 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2103 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -2156,7 +2164,7 @@ copyRetry:
2156 } 2164 }
2157 2165
2158 count = 1 /* 1st signature byte */ + name_len + name_len2; 2166 count = 1 /* 1st signature byte */ + name_len + name_len2;
2159 pSMB->hdr.smb_buf_length += count; 2167 inc_rfc1001_len(pSMB, count);
2160 pSMB->ByteCount = cpu_to_le16(count); 2168 pSMB->ByteCount = cpu_to_le16(count);
2161 2169
2162 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2170 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -2246,7 +2254,7 @@ createSymLinkRetry:
2246 pSMB->DataOffset = cpu_to_le16(offset); 2254 pSMB->DataOffset = cpu_to_le16(offset);
2247 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_LINK); 2255 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_LINK);
2248 pSMB->Reserved4 = 0; 2256 pSMB->Reserved4 = 0;
2249 pSMB->hdr.smb_buf_length += byte_count; 2257 inc_rfc1001_len(pSMB, byte_count);
2250 pSMB->ByteCount = cpu_to_le16(byte_count); 2258 pSMB->ByteCount = cpu_to_le16(byte_count);
2251 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2259 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2252 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2260 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -2332,7 +2340,7 @@ createHardLinkRetry:
2332 pSMB->DataOffset = cpu_to_le16(offset); 2340 pSMB->DataOffset = cpu_to_le16(offset);
2333 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_HLINK); 2341 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_HLINK);
2334 pSMB->Reserved4 = 0; 2342 pSMB->Reserved4 = 0;
2335 pSMB->hdr.smb_buf_length += byte_count; 2343 inc_rfc1001_len(pSMB, byte_count);
2336 pSMB->ByteCount = cpu_to_le16(byte_count); 2344 pSMB->ByteCount = cpu_to_le16(byte_count);
2337 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2345 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2338 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2346 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -2403,7 +2411,7 @@ winCreateHardLinkRetry:
2403 } 2411 }
2404 2412
2405 count = 1 /* string type byte */ + name_len + name_len2; 2413 count = 1 /* string type byte */ + name_len + name_len2;
2406 pSMB->hdr.smb_buf_length += count; 2414 inc_rfc1001_len(pSMB, count);
2407 pSMB->ByteCount = cpu_to_le16(count); 2415 pSMB->ByteCount = cpu_to_le16(count);
2408 2416
2409 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2417 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -2474,7 +2482,7 @@ querySymLinkRetry:
2474 pSMB->ParameterCount = pSMB->TotalParameterCount; 2482 pSMB->ParameterCount = pSMB->TotalParameterCount;
2475 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_LINK); 2483 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_LINK);
2476 pSMB->Reserved4 = 0; 2484 pSMB->Reserved4 = 0;
2477 pSMB->hdr.smb_buf_length += byte_count; 2485 inc_rfc1001_len(pSMB, byte_count);
2478 pSMB->ByteCount = cpu_to_le16(byte_count); 2486 pSMB->ByteCount = cpu_to_le16(byte_count);
2479 2487
2480 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2488 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -2821,7 +2829,7 @@ queryAclRetry:
2821 pSMB->ParameterCount = pSMB->TotalParameterCount; 2829 pSMB->ParameterCount = pSMB->TotalParameterCount;
2822 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_POSIX_ACL); 2830 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_POSIX_ACL);
2823 pSMB->Reserved4 = 0; 2831 pSMB->Reserved4 = 0;
2824 pSMB->hdr.smb_buf_length += byte_count; 2832 inc_rfc1001_len(pSMB, byte_count);
2825 pSMB->ByteCount = cpu_to_le16(byte_count); 2833 pSMB->ByteCount = cpu_to_le16(byte_count);
2826 2834
2827 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2835 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -2915,7 +2923,7 @@ setAclRetry:
2915 pSMB->ParameterCount = cpu_to_le16(params); 2923 pSMB->ParameterCount = cpu_to_le16(params);
2916 pSMB->TotalParameterCount = pSMB->ParameterCount; 2924 pSMB->TotalParameterCount = pSMB->ParameterCount;
2917 pSMB->Reserved4 = 0; 2925 pSMB->Reserved4 = 0;
2918 pSMB->hdr.smb_buf_length += byte_count; 2926 inc_rfc1001_len(pSMB, byte_count);
2919 pSMB->ByteCount = cpu_to_le16(byte_count); 2927 pSMB->ByteCount = cpu_to_le16(byte_count);
2920 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2928 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2921 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2929 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -2973,7 +2981,7 @@ GetExtAttrRetry:
2973 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_ATTR_FLAGS); 2981 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_ATTR_FLAGS);
2974 pSMB->Pad = 0; 2982 pSMB->Pad = 0;
2975 pSMB->Fid = netfid; 2983 pSMB->Fid = netfid;
2976 pSMB->hdr.smb_buf_length += byte_count; 2984 inc_rfc1001_len(pSMB, byte_count);
2977 pSMB->t2.ByteCount = cpu_to_le16(byte_count); 2985 pSMB->t2.ByteCount = cpu_to_le16(byte_count);
2978 2986
2979 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2987 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -3131,9 +3139,9 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
3131 pSMB->AclFlags = cpu_to_le32(CIFS_ACL_OWNER | CIFS_ACL_GROUP | 3139 pSMB->AclFlags = cpu_to_le32(CIFS_ACL_OWNER | CIFS_ACL_GROUP |
3132 CIFS_ACL_DACL); 3140 CIFS_ACL_DACL);
3133 pSMB->ByteCount = cpu_to_le16(11); /* 3 bytes pad + 8 bytes parm */ 3141 pSMB->ByteCount = cpu_to_le16(11); /* 3 bytes pad + 8 bytes parm */
3134 pSMB->hdr.smb_buf_length += 11; 3142 inc_rfc1001_len(pSMB, 11);
3135 iov[0].iov_base = (char *)pSMB; 3143 iov[0].iov_base = (char *)pSMB;
3136 iov[0].iov_len = pSMB->hdr.smb_buf_length + 4; 3144 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4;
3137 3145
3138 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type, 3146 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type,
3139 0); 3147 0);
@@ -3242,10 +3250,9 @@ setCifsAclRetry:
3242 memcpy((char *) &pSMBr->hdr.Protocol + data_offset, 3250 memcpy((char *) &pSMBr->hdr.Protocol + data_offset,
3243 (char *) pntsd, 3251 (char *) pntsd,
3244 acllen); 3252 acllen);
3245 pSMB->hdr.smb_buf_length += (byte_count + data_count); 3253 inc_rfc1001_len(pSMB, byte_count + data_count);
3246
3247 } else 3254 } else
3248 pSMB->hdr.smb_buf_length += byte_count; 3255 inc_rfc1001_len(pSMB, byte_count);
3249 3256
3250 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3257 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3251 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3258 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -3296,7 +3303,7 @@ QInfRetry:
3296 } 3303 }
3297 pSMB->BufferFormat = 0x04; 3304 pSMB->BufferFormat = 0x04;
3298 name_len++; /* account for buffer type byte */ 3305 name_len++; /* account for buffer type byte */
3299 pSMB->hdr.smb_buf_length += (__u16) name_len; 3306 inc_rfc1001_len(pSMB, (__u16)name_len);
3300 pSMB->ByteCount = cpu_to_le16(name_len); 3307 pSMB->ByteCount = cpu_to_le16(name_len);
3301 3308
3302 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3309 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -3371,7 +3378,7 @@ QFileInfoRetry:
3371 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_ALL_INFO); 3378 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_ALL_INFO);
3372 pSMB->Pad = 0; 3379 pSMB->Pad = 0;
3373 pSMB->Fid = netfid; 3380 pSMB->Fid = netfid;
3374 pSMB->hdr.smb_buf_length += byte_count; 3381 inc_rfc1001_len(pSMB, byte_count);
3375 3382
3376 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3383 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3377 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3384 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -3458,7 +3465,7 @@ QPathInfoRetry:
3458 else 3465 else
3459 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_ALL_INFO); 3466 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_ALL_INFO);
3460 pSMB->Reserved4 = 0; 3467 pSMB->Reserved4 = 0;
3461 pSMB->hdr.smb_buf_length += byte_count; 3468 inc_rfc1001_len(pSMB, byte_count);
3462 pSMB->ByteCount = cpu_to_le16(byte_count); 3469 pSMB->ByteCount = cpu_to_le16(byte_count);
3463 3470
3464 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3471 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -3539,7 +3546,7 @@ UnixQFileInfoRetry:
3539 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC); 3546 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC);
3540 pSMB->Pad = 0; 3547 pSMB->Pad = 0;
3541 pSMB->Fid = netfid; 3548 pSMB->Fid = netfid;
3542 pSMB->hdr.smb_buf_length += byte_count; 3549 inc_rfc1001_len(pSMB, byte_count);
3543 3550
3544 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3551 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3545 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3552 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -3624,7 +3631,7 @@ UnixQPathInfoRetry:
3624 pSMB->ParameterCount = pSMB->TotalParameterCount; 3631 pSMB->ParameterCount = pSMB->TotalParameterCount;
3625 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC); 3632 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC);
3626 pSMB->Reserved4 = 0; 3633 pSMB->Reserved4 = 0;
3627 pSMB->hdr.smb_buf_length += byte_count; 3634 inc_rfc1001_len(pSMB, byte_count);
3628 pSMB->ByteCount = cpu_to_le16(byte_count); 3635 pSMB->ByteCount = cpu_to_le16(byte_count);
3629 3636
3630 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3637 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -3738,7 +3745,7 @@ findFirstRetry:
3738 3745
3739 /* BB what should we set StorageType to? Does it matter? BB */ 3746 /* BB what should we set StorageType to? Does it matter? BB */
3740 pSMB->SearchStorageType = 0; 3747 pSMB->SearchStorageType = 0;
3741 pSMB->hdr.smb_buf_length += byte_count; 3748 inc_rfc1001_len(pSMB, byte_count);
3742 pSMB->ByteCount = cpu_to_le16(byte_count); 3749 pSMB->ByteCount = cpu_to_le16(byte_count);
3743 3750
3744 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3751 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -3867,7 +3874,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
3867 byte_count = params + 1 /* pad */ ; 3874 byte_count = params + 1 /* pad */ ;
3868 pSMB->TotalParameterCount = cpu_to_le16(params); 3875 pSMB->TotalParameterCount = cpu_to_le16(params);
3869 pSMB->ParameterCount = pSMB->TotalParameterCount; 3876 pSMB->ParameterCount = pSMB->TotalParameterCount;
3870 pSMB->hdr.smb_buf_length += byte_count; 3877 inc_rfc1001_len(pSMB, byte_count);
3871 pSMB->ByteCount = cpu_to_le16(byte_count); 3878 pSMB->ByteCount = cpu_to_le16(byte_count);
3872 3879
3873 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3880 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4029,7 +4036,7 @@ GetInodeNumberRetry:
4029 pSMB->ParameterCount = pSMB->TotalParameterCount; 4036 pSMB->ParameterCount = pSMB->TotalParameterCount;
4030 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_INTERNAL_INFO); 4037 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FILE_INTERNAL_INFO);
4031 pSMB->Reserved4 = 0; 4038 pSMB->Reserved4 = 0;
4032 pSMB->hdr.smb_buf_length += byte_count; 4039 inc_rfc1001_len(pSMB, byte_count);
4033 pSMB->ByteCount = cpu_to_le16(byte_count); 4040 pSMB->ByteCount = cpu_to_le16(byte_count);
4034 4041
4035 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4042 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4253,7 +4260,7 @@ getDFSRetry:
4253 pSMB->ParameterCount = cpu_to_le16(params); 4260 pSMB->ParameterCount = cpu_to_le16(params);
4254 pSMB->TotalParameterCount = pSMB->ParameterCount; 4261 pSMB->TotalParameterCount = pSMB->ParameterCount;
4255 pSMB->MaxReferralLevel = cpu_to_le16(3); 4262 pSMB->MaxReferralLevel = cpu_to_le16(3);
4256 pSMB->hdr.smb_buf_length += byte_count; 4263 inc_rfc1001_len(pSMB, byte_count);
4257 pSMB->ByteCount = cpu_to_le16(byte_count); 4264 pSMB->ByteCount = cpu_to_le16(byte_count);
4258 4265
4259 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB, 4266 rc = SendReceive(xid, ses, (struct smb_hdr *) pSMB,
@@ -4327,7 +4334,7 @@ oldQFSInfoRetry:
4327 pSMB->Reserved3 = 0; 4334 pSMB->Reserved3 = 0;
4328 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); 4335 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION);
4329 pSMB->InformationLevel = cpu_to_le16(SMB_INFO_ALLOCATION); 4336 pSMB->InformationLevel = cpu_to_le16(SMB_INFO_ALLOCATION);
4330 pSMB->hdr.smb_buf_length += byte_count; 4337 inc_rfc1001_len(pSMB, byte_count);
4331 pSMB->ByteCount = cpu_to_le16(byte_count); 4338 pSMB->ByteCount = cpu_to_le16(byte_count);
4332 4339
4333 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4340 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4406,7 +4413,7 @@ QFSInfoRetry:
4406 pSMB->Reserved3 = 0; 4413 pSMB->Reserved3 = 0;
4407 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); 4414 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION);
4408 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_SIZE_INFO); 4415 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_SIZE_INFO);
4409 pSMB->hdr.smb_buf_length += byte_count; 4416 inc_rfc1001_len(pSMB, byte_count);
4410 pSMB->ByteCount = cpu_to_le16(byte_count); 4417 pSMB->ByteCount = cpu_to_le16(byte_count);
4411 4418
4412 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4419 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4486,7 +4493,7 @@ QFSAttributeRetry:
4486 pSMB->Reserved3 = 0; 4493 pSMB->Reserved3 = 0;
4487 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); 4494 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION);
4488 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_ATTRIBUTE_INFO); 4495 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_ATTRIBUTE_INFO);
4489 pSMB->hdr.smb_buf_length += byte_count; 4496 inc_rfc1001_len(pSMB, byte_count);
4490 pSMB->ByteCount = cpu_to_le16(byte_count); 4497 pSMB->ByteCount = cpu_to_le16(byte_count);
4491 4498
4492 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4499 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4557,7 +4564,7 @@ QFSDeviceRetry:
4557 pSMB->Reserved3 = 0; 4564 pSMB->Reserved3 = 0;
4558 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); 4565 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION);
4559 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_DEVICE_INFO); 4566 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_DEVICE_INFO);
4560 pSMB->hdr.smb_buf_length += byte_count; 4567 inc_rfc1001_len(pSMB, byte_count);
4561 pSMB->ByteCount = cpu_to_le16(byte_count); 4568 pSMB->ByteCount = cpu_to_le16(byte_count);
4562 4569
4563 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4570 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4626,7 +4633,7 @@ QFSUnixRetry:
4626 pSMB->Reserved3 = 0; 4633 pSMB->Reserved3 = 0;
4627 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); 4634 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION);
4628 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_CIFS_UNIX_INFO); 4635 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_CIFS_UNIX_INFO);
4629 pSMB->hdr.smb_buf_length += byte_count; 4636 inc_rfc1001_len(pSMB, byte_count);
4630 pSMB->ByteCount = cpu_to_le16(byte_count); 4637 pSMB->ByteCount = cpu_to_le16(byte_count);
4631 4638
4632 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4639 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4709,7 +4716,7 @@ SETFSUnixRetry:
4709 pSMB->ClientUnixMinor = cpu_to_le16(CIFS_UNIX_MINOR_VERSION); 4716 pSMB->ClientUnixMinor = cpu_to_le16(CIFS_UNIX_MINOR_VERSION);
4710 pSMB->ClientUnixCap = cpu_to_le64(cap); 4717 pSMB->ClientUnixCap = cpu_to_le64(cap);
4711 4718
4712 pSMB->hdr.smb_buf_length += byte_count; 4719 inc_rfc1001_len(pSMB, byte_count);
4713 pSMB->ByteCount = cpu_to_le16(byte_count); 4720 pSMB->ByteCount = cpu_to_le16(byte_count);
4714 4721
4715 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4722 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4771,7 +4778,7 @@ QFSPosixRetry:
4771 pSMB->Reserved3 = 0; 4778 pSMB->Reserved3 = 0;
4772 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION); 4779 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FS_INFORMATION);
4773 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_POSIX_FS_INFO); 4780 pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_POSIX_FS_INFO);
4774 pSMB->hdr.smb_buf_length += byte_count; 4781 inc_rfc1001_len(pSMB, byte_count);
4775 pSMB->ByteCount = cpu_to_le16(byte_count); 4782 pSMB->ByteCount = cpu_to_le16(byte_count);
4776 4783
4777 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4784 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4897,7 +4904,7 @@ SetEOFRetry:
4897 pSMB->ParameterCount = cpu_to_le16(params); 4904 pSMB->ParameterCount = cpu_to_le16(params);
4898 pSMB->TotalParameterCount = pSMB->ParameterCount; 4905 pSMB->TotalParameterCount = pSMB->ParameterCount;
4899 pSMB->Reserved4 = 0; 4906 pSMB->Reserved4 = 0;
4900 pSMB->hdr.smb_buf_length += byte_count; 4907 inc_rfc1001_len(pSMB, byte_count);
4901 parm_data->FileSize = cpu_to_le64(size); 4908 parm_data->FileSize = cpu_to_le64(size);
4902 pSMB->ByteCount = cpu_to_le16(byte_count); 4909 pSMB->ByteCount = cpu_to_le16(byte_count);
4903 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4910 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -4976,7 +4983,7 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
4976 cpu_to_le16(SMB_SET_FILE_END_OF_FILE_INFO); 4983 cpu_to_le16(SMB_SET_FILE_END_OF_FILE_INFO);
4977 } 4984 }
4978 pSMB->Reserved4 = 0; 4985 pSMB->Reserved4 = 0;
4979 pSMB->hdr.smb_buf_length += byte_count; 4986 inc_rfc1001_len(pSMB, byte_count);
4980 pSMB->ByteCount = cpu_to_le16(byte_count); 4987 pSMB->ByteCount = cpu_to_le16(byte_count);
4981 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); 4988 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
4982 if (rc) { 4989 if (rc) {
@@ -5044,7 +5051,7 @@ CIFSSMBSetFileInfo(const int xid, struct cifsTconInfo *tcon,
5044 else 5051 else
5045 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO); 5052 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO);
5046 pSMB->Reserved4 = 0; 5053 pSMB->Reserved4 = 0;
5047 pSMB->hdr.smb_buf_length += byte_count; 5054 inc_rfc1001_len(pSMB, byte_count);
5048 pSMB->ByteCount = cpu_to_le16(byte_count); 5055 pSMB->ByteCount = cpu_to_le16(byte_count);
5049 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); 5056 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO));
5050 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); 5057 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
@@ -5103,7 +5110,7 @@ CIFSSMBSetFileDisposition(const int xid, struct cifsTconInfo *tcon,
5103 pSMB->Fid = fid; 5110 pSMB->Fid = fid;
5104 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_DISPOSITION_INFO); 5111 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_DISPOSITION_INFO);
5105 pSMB->Reserved4 = 0; 5112 pSMB->Reserved4 = 0;
5106 pSMB->hdr.smb_buf_length += byte_count; 5113 inc_rfc1001_len(pSMB, byte_count);
5107 pSMB->ByteCount = cpu_to_le16(byte_count); 5114 pSMB->ByteCount = cpu_to_le16(byte_count);
5108 *data_offset = delete_file ? 1 : 0; 5115 *data_offset = delete_file ? 1 : 0;
5109 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0); 5116 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
@@ -5176,7 +5183,7 @@ SetTimesRetry:
5176 else 5183 else
5177 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO); 5184 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO);
5178 pSMB->Reserved4 = 0; 5185 pSMB->Reserved4 = 0;
5179 pSMB->hdr.smb_buf_length += byte_count; 5186 inc_rfc1001_len(pSMB, byte_count);
5180 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO)); 5187 memcpy(data_offset, data, sizeof(FILE_BASIC_INFO));
5181 pSMB->ByteCount = cpu_to_le16(byte_count); 5188 pSMB->ByteCount = cpu_to_le16(byte_count);
5182 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5189 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -5228,7 +5235,7 @@ SetAttrLgcyRetry:
5228 } 5235 }
5229 pSMB->attr = cpu_to_le16(dos_attrs); 5236 pSMB->attr = cpu_to_le16(dos_attrs);
5230 pSMB->BufferFormat = 0x04; 5237 pSMB->BufferFormat = 0x04;
5231 pSMB->hdr.smb_buf_length += name_len + 1; 5238 inc_rfc1001_len(pSMB, name_len + 1);
5232 pSMB->ByteCount = cpu_to_le16(name_len + 1); 5239 pSMB->ByteCount = cpu_to_le16(name_len + 1);
5233 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5240 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5234 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5241 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -5333,7 +5340,7 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifsTconInfo *tcon,
5333 pSMB->Fid = fid; 5340 pSMB->Fid = fid;
5334 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC); 5341 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC);
5335 pSMB->Reserved4 = 0; 5342 pSMB->Reserved4 = 0;
5336 pSMB->hdr.smb_buf_length += byte_count; 5343 inc_rfc1001_len(pSMB, byte_count);
5337 pSMB->ByteCount = cpu_to_le16(byte_count); 5344 pSMB->ByteCount = cpu_to_le16(byte_count);
5338 5345
5339 cifs_fill_unix_set_info(data_offset, args); 5346 cifs_fill_unix_set_info(data_offset, args);
@@ -5409,7 +5416,7 @@ setPermsRetry:
5409 pSMB->TotalDataCount = pSMB->DataCount; 5416 pSMB->TotalDataCount = pSMB->DataCount;
5410 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC); 5417 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC);
5411 pSMB->Reserved4 = 0; 5418 pSMB->Reserved4 = 0;
5412 pSMB->hdr.smb_buf_length += byte_count; 5419 inc_rfc1001_len(pSMB, byte_count);
5413 5420
5414 cifs_fill_unix_set_info(data_offset, args); 5421 cifs_fill_unix_set_info(data_offset, args);
5415 5422
@@ -5494,7 +5501,7 @@ QAllEAsRetry:
5494 pSMB->ParameterCount = pSMB->TotalParameterCount; 5501 pSMB->ParameterCount = pSMB->TotalParameterCount;
5495 pSMB->InformationLevel = cpu_to_le16(SMB_INFO_QUERY_ALL_EAS); 5502 pSMB->InformationLevel = cpu_to_le16(SMB_INFO_QUERY_ALL_EAS);
5496 pSMB->Reserved4 = 0; 5503 pSMB->Reserved4 = 0;
5497 pSMB->hdr.smb_buf_length += byte_count; 5504 inc_rfc1001_len(pSMB, byte_count);
5498 pSMB->ByteCount = cpu_to_le16(byte_count); 5505 pSMB->ByteCount = cpu_to_le16(byte_count);
5499 5506
5500 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5507 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
@@ -5707,7 +5714,7 @@ SetEARetry:
5707 pSMB->ParameterCount = cpu_to_le16(params); 5714 pSMB->ParameterCount = cpu_to_le16(params);
5708 pSMB->TotalParameterCount = pSMB->ParameterCount; 5715 pSMB->TotalParameterCount = pSMB->ParameterCount;
5709 pSMB->Reserved4 = 0; 5716 pSMB->Reserved4 = 0;
5710 pSMB->hdr.smb_buf_length += byte_count; 5717 inc_rfc1001_len(pSMB, byte_count);
5711 pSMB->ByteCount = cpu_to_le16(byte_count); 5718 pSMB->ByteCount = cpu_to_le16(byte_count);
5712 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5719 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
5713 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5720 (struct smb_hdr *) pSMBr, &bytes_returned, 0);