diff options
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 1cbe61524efc..3c05c2de50e1 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -1247,7 +1247,7 @@ OldOpenRetry: | |||
1247 | } else { | 1247 | } else { |
1248 | /* BB verify if wct == 15 */ | 1248 | /* BB verify if wct == 15 */ |
1249 | 1249 | ||
1250 | /* *pOplock = pSMBr->OplockLevel; */ /* BB take from action field BB */ | 1250 | /* *pOplock = pSMBr->OplockLevel; */ /* BB take from action field*/ |
1251 | 1251 | ||
1252 | *netfid = pSMBr->Fid; /* cifs fid stays in le */ | 1252 | *netfid = pSMBr->Fid; /* cifs fid stays in le */ |
1253 | /* Let caller know file was created so we can set the mode. */ | 1253 | /* Let caller know file was created so we can set the mode. */ |
@@ -1944,7 +1944,7 @@ renameRetry: | |||
1944 | /* protocol requires ASCII signature byte on Unicode string */ | 1944 | /* protocol requires ASCII signature byte on Unicode string */ |
1945 | pSMB->OldFileName[name_len + 1] = 0x00; | 1945 | pSMB->OldFileName[name_len + 1] = 0x00; |
1946 | name_len2 = | 1946 | name_len2 = |
1947 | cifsConvertToUCS((__le16 *) &pSMB->OldFileName[name_len + 2], | 1947 | cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2], |
1948 | toName, PATH_MAX, nls_codepage, remap); | 1948 | toName, PATH_MAX, nls_codepage, remap); |
1949 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; | 1949 | name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; |
1950 | name_len2 *= 2; /* convert to bytes */ | 1950 | name_len2 *= 2; /* convert to bytes */ |
@@ -2925,7 +2925,8 @@ setAclRetry: | |||
2925 | } | 2925 | } |
2926 | params = 6 + name_len; | 2926 | params = 6 + name_len; |
2927 | pSMB->MaxParameterCount = cpu_to_le16(2); | 2927 | pSMB->MaxParameterCount = cpu_to_le16(2); |
2928 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB size from sess */ | 2928 | /* BB find max SMB size from sess */ |
2929 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
2929 | pSMB->MaxSetupCount = 0; | 2930 | pSMB->MaxSetupCount = 0; |
2930 | pSMB->Reserved = 0; | 2931 | pSMB->Reserved = 0; |
2931 | pSMB->Flags = 0; | 2932 | pSMB->Flags = 0; |
@@ -3322,7 +3323,8 @@ QPathInfoRetry: | |||
3322 | params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; | 3323 | params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; |
3323 | pSMB->TotalDataCount = 0; | 3324 | pSMB->TotalDataCount = 0; |
3324 | pSMB->MaxParameterCount = cpu_to_le16(2); | 3325 | pSMB->MaxParameterCount = cpu_to_le16(2); |
3325 | pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ | 3326 | /* BB find exact max SMB PDU from sess structure BB */ |
3327 | pSMB->MaxDataCount = cpu_to_le16(4000); | ||
3326 | pSMB->MaxSetupCount = 0; | 3328 | pSMB->MaxSetupCount = 0; |
3327 | pSMB->Reserved = 0; | 3329 | pSMB->Reserved = 0; |
3328 | pSMB->Flags = 0; | 3330 | pSMB->Flags = 0; |
@@ -3388,7 +3390,7 @@ QPathInfoRetry: | |||
3388 | int | 3390 | int |
3389 | CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon, | 3391 | CIFSSMBUnixQPathInfo(const int xid, struct cifsTconInfo *tcon, |
3390 | const unsigned char *searchName, | 3392 | const unsigned char *searchName, |
3391 | FILE_UNIX_BASIC_INFO * pFindData, | 3393 | FILE_UNIX_BASIC_INFO *pFindData, |
3392 | const struct nls_table *nls_codepage, int remap) | 3394 | const struct nls_table *nls_codepage, int remap) |
3393 | { | 3395 | { |
3394 | /* SMB_QUERY_FILE_UNIX_BASIC */ | 3396 | /* SMB_QUERY_FILE_UNIX_BASIC */ |
@@ -3922,7 +3924,8 @@ getDFSRetry: | |||
3922 | pSMB->DataCount = 0; | 3924 | pSMB->DataCount = 0; |
3923 | pSMB->DataOffset = 0; | 3925 | pSMB->DataOffset = 0; |
3924 | pSMB->MaxParameterCount = 0; | 3926 | pSMB->MaxParameterCount = 0; |
3925 | pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ | 3927 | /* BB find exact max SMB PDU from sess structure BB */ |
3928 | pSMB->MaxDataCount = cpu_to_le16(4000); | ||
3926 | pSMB->MaxSetupCount = 0; | 3929 | pSMB->MaxSetupCount = 0; |
3927 | pSMB->Reserved = 0; | 3930 | pSMB->Reserved = 0; |
3928 | pSMB->Flags = 0; | 3931 | pSMB->Flags = 0; |
@@ -4230,7 +4233,8 @@ QFSAttributeRetry: | |||
4230 | params = 2; /* level */ | 4233 | params = 2; /* level */ |
4231 | pSMB->TotalDataCount = 0; | 4234 | pSMB->TotalDataCount = 0; |
4232 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4235 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4233 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ | 4236 | /* BB find exact max SMB PDU from sess structure BB */ |
4237 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
4234 | pSMB->MaxSetupCount = 0; | 4238 | pSMB->MaxSetupCount = 0; |
4235 | pSMB->Reserved = 0; | 4239 | pSMB->Reserved = 0; |
4236 | pSMB->Flags = 0; | 4240 | pSMB->Flags = 0; |
@@ -4299,7 +4303,8 @@ QFSDeviceRetry: | |||
4299 | params = 2; /* level */ | 4303 | params = 2; /* level */ |
4300 | pSMB->TotalDataCount = 0; | 4304 | pSMB->TotalDataCount = 0; |
4301 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4305 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4302 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ | 4306 | /* BB find exact max SMB PDU from sess structure BB */ |
4307 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
4303 | pSMB->MaxSetupCount = 0; | 4308 | pSMB->MaxSetupCount = 0; |
4304 | pSMB->Reserved = 0; | 4309 | pSMB->Reserved = 0; |
4305 | pSMB->Flags = 0; | 4310 | pSMB->Flags = 0; |
@@ -4370,7 +4375,8 @@ QFSUnixRetry: | |||
4370 | pSMB->DataCount = 0; | 4375 | pSMB->DataCount = 0; |
4371 | pSMB->DataOffset = 0; | 4376 | pSMB->DataOffset = 0; |
4372 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4377 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4373 | pSMB->MaxDataCount = cpu_to_le16(100); /* BB find exact max SMB PDU from sess structure BB */ | 4378 | /* BB find exact max SMB PDU from sess structure BB */ |
4379 | pSMB->MaxDataCount = cpu_to_le16(100); | ||
4374 | pSMB->MaxSetupCount = 0; | 4380 | pSMB->MaxSetupCount = 0; |
4375 | pSMB->Reserved = 0; | 4381 | pSMB->Reserved = 0; |
4376 | pSMB->Flags = 0; | 4382 | pSMB->Flags = 0; |
@@ -4445,7 +4451,8 @@ SETFSUnixRetry: | |||
4445 | offset = param_offset + params; | 4451 | offset = param_offset + params; |
4446 | 4452 | ||
4447 | pSMB->MaxParameterCount = cpu_to_le16(4); | 4453 | pSMB->MaxParameterCount = cpu_to_le16(4); |
4448 | pSMB->MaxDataCount = cpu_to_le16(100); /* BB find exact max SMB PDU from sess structure BB */ | 4454 | /* BB find exact max SMB PDU from sess structure BB */ |
4455 | pSMB->MaxDataCount = cpu_to_le16(100); | ||
4449 | pSMB->SetupCount = 1; | 4456 | pSMB->SetupCount = 1; |
4450 | pSMB->Reserved3 = 0; | 4457 | pSMB->Reserved3 = 0; |
4451 | pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FS_INFORMATION); | 4458 | pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FS_INFORMATION); |
@@ -4513,7 +4520,8 @@ QFSPosixRetry: | |||
4513 | pSMB->DataCount = 0; | 4520 | pSMB->DataCount = 0; |
4514 | pSMB->DataOffset = 0; | 4521 | pSMB->DataOffset = 0; |
4515 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4522 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4516 | pSMB->MaxDataCount = cpu_to_le16(100); /* BB find exact max SMB PDU from sess structure BB */ | 4523 | /* BB find exact max SMB PDU from sess structure BB */ |
4524 | pSMB->MaxDataCount = cpu_to_le16(100); | ||
4517 | pSMB->MaxSetupCount = 0; | 4525 | pSMB->MaxSetupCount = 0; |
4518 | pSMB->Reserved = 0; | 4526 | pSMB->Reserved = 0; |
4519 | pSMB->Flags = 0; | 4527 | pSMB->Flags = 0; |
@@ -4703,7 +4711,8 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size, | |||
4703 | 4711 | ||
4704 | count = sizeof(struct file_end_of_file_info); | 4712 | count = sizeof(struct file_end_of_file_info); |
4705 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4713 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4706 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */ | 4714 | /* BB find exact max SMB PDU from sess structure BB */ |
4715 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
4707 | pSMB->SetupCount = 1; | 4716 | pSMB->SetupCount = 1; |
4708 | pSMB->Reserved3 = 0; | 4717 | pSMB->Reserved3 = 0; |
4709 | pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); | 4718 | pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); |
@@ -4790,7 +4799,8 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon, | |||
4790 | 4799 | ||
4791 | count = sizeof(FILE_BASIC_INFO); | 4800 | count = sizeof(FILE_BASIC_INFO); |
4792 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4801 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4793 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */ | 4802 | /* BB find max SMB PDU from sess */ |
4803 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
4794 | pSMB->SetupCount = 1; | 4804 | pSMB->SetupCount = 1; |
4795 | pSMB->Reserved3 = 0; | 4805 | pSMB->Reserved3 = 0; |
4796 | pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); | 4806 | pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); |
@@ -4857,7 +4867,8 @@ SetTimesRetry: | |||
4857 | params = 6 + name_len; | 4867 | params = 6 + name_len; |
4858 | count = sizeof(FILE_BASIC_INFO); | 4868 | count = sizeof(FILE_BASIC_INFO); |
4859 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4869 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4860 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ | 4870 | /* BB find max SMB PDU from sess structure BB */ |
4871 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
4861 | pSMB->MaxSetupCount = 0; | 4872 | pSMB->MaxSetupCount = 0; |
4862 | pSMB->Reserved = 0; | 4873 | pSMB->Reserved = 0; |
4863 | pSMB->Flags = 0; | 4874 | pSMB->Flags = 0; |
@@ -4987,7 +4998,8 @@ setPermsRetry: | |||
4987 | params = 6 + name_len; | 4998 | params = 6 + name_len; |
4988 | count = sizeof(FILE_UNIX_BASIC_INFO); | 4999 | count = sizeof(FILE_UNIX_BASIC_INFO); |
4989 | pSMB->MaxParameterCount = cpu_to_le16(2); | 5000 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4990 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find exact max SMB PDU from sess structure BB */ | 5001 | /* BB find max SMB PDU from sess structure BB */ |
5002 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
4991 | pSMB->MaxSetupCount = 0; | 5003 | pSMB->MaxSetupCount = 0; |
4992 | pSMB->Reserved = 0; | 5004 | pSMB->Reserved = 0; |
4993 | pSMB->Flags = 0; | 5005 | pSMB->Flags = 0; |
@@ -5170,7 +5182,8 @@ QAllEAsRetry: | |||
5170 | params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; | 5182 | params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; |
5171 | pSMB->TotalDataCount = 0; | 5183 | pSMB->TotalDataCount = 0; |
5172 | pSMB->MaxParameterCount = cpu_to_le16(2); | 5184 | pSMB->MaxParameterCount = cpu_to_le16(2); |
5173 | pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ | 5185 | /* BB find exact max SMB PDU from sess structure BB */ |
5186 | pSMB->MaxDataCount = cpu_to_le16(4000); | ||
5174 | pSMB->MaxSetupCount = 0; | 5187 | pSMB->MaxSetupCount = 0; |
5175 | pSMB->Reserved = 0; | 5188 | pSMB->Reserved = 0; |
5176 | pSMB->Flags = 0; | 5189 | pSMB->Flags = 0; |
@@ -5318,7 +5331,8 @@ QEARetry: | |||
5318 | params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; | 5331 | params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; |
5319 | pSMB->TotalDataCount = 0; | 5332 | pSMB->TotalDataCount = 0; |
5320 | pSMB->MaxParameterCount = cpu_to_le16(2); | 5333 | pSMB->MaxParameterCount = cpu_to_le16(2); |
5321 | pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */ | 5334 | /* BB find exact max SMB PDU from sess structure BB */ |
5335 | pSMB->MaxDataCount = cpu_to_le16(4000); | ||
5322 | pSMB->MaxSetupCount = 0; | 5336 | pSMB->MaxSetupCount = 0; |
5323 | pSMB->Reserved = 0; | 5337 | pSMB->Reserved = 0; |
5324 | pSMB->Flags = 0; | 5338 | pSMB->Flags = 0; |
@@ -5476,7 +5490,8 @@ SetEARetry: | |||
5476 | 5490 | ||
5477 | count = sizeof(*parm_data) + ea_value_len + name_len; | 5491 | count = sizeof(*parm_data) + ea_value_len + name_len; |
5478 | pSMB->MaxParameterCount = cpu_to_le16(2); | 5492 | pSMB->MaxParameterCount = cpu_to_le16(2); |
5479 | pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB size from sess */ | 5493 | /* BB find max SMB PDU from sess */ |
5494 | pSMB->MaxDataCount = cpu_to_le16(1000); | ||
5480 | pSMB->MaxSetupCount = 0; | 5495 | pSMB->MaxSetupCount = 0; |
5481 | pSMB->Reserved = 0; | 5496 | pSMB->Reserved = 0; |
5482 | pSMB->Flags = 0; | 5497 | pSMB->Flags = 0; |