diff options
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index daf717e6b6eb..52caac063a77 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -779,7 +779,7 @@ OldOpenRetry: | |||
779 | /* BB FIXME END BB */ | 779 | /* BB FIXME END BB */ |
780 | 780 | ||
781 | pSMB->Sattr = cpu_to_le16(ATTR_HIDDEN | ATTR_SYSTEM | ATTR_DIRECTORY); | 781 | pSMB->Sattr = cpu_to_le16(ATTR_HIDDEN | ATTR_SYSTEM | ATTR_DIRECTORY); |
782 | pSMB->OpenFunction = convert_disposition(openDisposition); | 782 | pSMB->OpenFunction = cpu_to_le16(convert_disposition(openDisposition)); |
783 | count += name_len; | 783 | count += name_len; |
784 | pSMB->hdr.smb_buf_length += count; | 784 | pSMB->hdr.smb_buf_length += count; |
785 | 785 | ||
@@ -808,10 +808,12 @@ OldOpenRetry: | |||
808 | pfile_info->LastAccessTime = 0; /* BB fixme */ | 808 | pfile_info->LastAccessTime = 0; /* BB fixme */ |
809 | pfile_info->LastWriteTime = 0; /* BB fixme */ | 809 | pfile_info->LastWriteTime = 0; /* BB fixme */ |
810 | pfile_info->ChangeTime = 0; /* BB fixme */ | 810 | pfile_info->ChangeTime = 0; /* BB fixme */ |
811 | pfile_info->Attributes = pSMBr->FileAttributes; | 811 | pfile_info->Attributes = |
812 | cpu_to_le32(le16_to_cpu(pSMBr->FileAttributes)); | ||
812 | /* the file_info buf is endian converted by caller */ | 813 | /* the file_info buf is endian converted by caller */ |
813 | pfile_info->AllocationSize = pSMBr->EndOfFile; | 814 | pfile_info->AllocationSize = |
814 | pfile_info->EndOfFile = pSMBr->EndOfFile; | 815 | cpu_to_le64(le32_to_cpu(pSMBr->EndOfFile)); |
816 | pfile_info->EndOfFile = pfile_info->AllocationSize; | ||
815 | pfile_info->NumberOfLinks = cpu_to_le32(1); | 817 | pfile_info->NumberOfLinks = cpu_to_le32(1); |
816 | } | 818 | } |
817 | } | 819 | } |
@@ -2390,9 +2392,11 @@ QInfRetry: | |||
2390 | cFYI(1, ("Send error in QueryInfo = %d", rc)); | 2392 | cFYI(1, ("Send error in QueryInfo = %d", rc)); |
2391 | } else if (pFinfo) { /* decode response */ | 2393 | } else if (pFinfo) { /* decode response */ |
2392 | memset(pFinfo, 0, sizeof(FILE_ALL_INFO)); | 2394 | memset(pFinfo, 0, sizeof(FILE_ALL_INFO)); |
2393 | pFinfo->AllocationSize = (__le64) pSMBr->size; | 2395 | pFinfo->AllocationSize = |
2394 | pFinfo->EndOfFile = (__le64) pSMBr->size; | 2396 | cpu_to_le64(le32_to_cpu(pSMBr->size)); |
2395 | pFinfo->Attributes = (__le32) pSMBr->attr; | 2397 | pFinfo->EndOfFile = pFinfo->AllocationSize; |
2398 | pFinfo->Attributes = | ||
2399 | cpu_to_le32(le16_to_cpu(pSMBr->attr)); | ||
2396 | } else | 2400 | } else |
2397 | rc = -EIO; /* bad buffer passed in */ | 2401 | rc = -EIO; /* bad buffer passed in */ |
2398 | 2402 | ||
@@ -3722,16 +3726,16 @@ QFSPosixRetry: | |||
3722 | le64_to_cpu(response_data->TotalBlocks); | 3726 | le64_to_cpu(response_data->TotalBlocks); |
3723 | FSData->f_bfree = | 3727 | FSData->f_bfree = |
3724 | le64_to_cpu(response_data->BlocksAvail); | 3728 | le64_to_cpu(response_data->BlocksAvail); |
3725 | if(response_data->UserBlocksAvail == -1) { | 3729 | if(response_data->UserBlocksAvail == cpu_to_le64(-1)) { |
3726 | FSData->f_bavail = FSData->f_bfree; | 3730 | FSData->f_bavail = FSData->f_bfree; |
3727 | } else { | 3731 | } else { |
3728 | FSData->f_bavail = | 3732 | FSData->f_bavail = |
3729 | le64_to_cpu(response_data->UserBlocksAvail); | 3733 | le64_to_cpu(response_data->UserBlocksAvail); |
3730 | } | 3734 | } |
3731 | if(response_data->TotalFileNodes != -1) | 3735 | if(response_data->TotalFileNodes != cpu_to_le64(-1)) |
3732 | FSData->f_files = | 3736 | FSData->f_files = |
3733 | le64_to_cpu(response_data->TotalFileNodes); | 3737 | le64_to_cpu(response_data->TotalFileNodes); |
3734 | if(response_data->FreeFileNodes != -1) | 3738 | if(response_data->FreeFileNodes != cpu_to_le64(-1)) |
3735 | FSData->f_ffree = | 3739 | FSData->f_ffree = |
3736 | le64_to_cpu(response_data->FreeFileNodes); | 3740 | le64_to_cpu(response_data->FreeFileNodes); |
3737 | } | 3741 | } |