diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 16:37:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 16:37:49 -0400 |
commit | 91444f47b2a0e50a15849f49db8c15382cd8de1b (patch) | |
tree | f565abed6640cc07607729969643551202f77e57 /fs/cifs/misc.c | |
parent | bc091c93a0f60717aa99e25c406892cd8c0187dc (diff) | |
parent | 156ecb2d8b06589098f6ce3012e6a10fef07c416 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (32 commits)
[CIFS] Fix to problem with getattr caused by invalidate simplification patch
[CIFS] Remove sparse warning
[CIFS] Update cifs to version 1.72
cifs: Change key name to cifs.idmap, misc. clean-up
cifs: Unconditionally copy mount options to superblock info
cifs: Use kstrndup for cifs_sb->mountdata
cifs: Simplify handling of submount options in cifs_mount.
cifs: cifs_parse_mount_options: do not tokenize mount options in-place
cifs: Add support for mounting Windows 2008 DFS shares
cifs: Extract DFS referral expansion logic to separate function
cifs: turn BCC into a static inlined function
cifs: keep BCC in little-endian format
cifs: fix some unused variable warnings in id_rb_search
CIFS: Simplify invalidate part (try #5)
CIFS: directio read/write cleanups
consistently use smb_buf_length as be32 for cifs (try 3)
cifs: Invoke id mapping functions (try #17 repost)
cifs: Add idmap key and related data structures and functions (try #17 repost)
CIFS: Add launder_page operation (try #3)
Introduce smb2 mounts as vers=2
...
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r-- | fs/cifs/misc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 0c684ae4c071..907531ac5888 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -304,12 +304,10 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ , | |||
304 | 304 | ||
305 | memset(temp, 0, 256); /* bigger than MAX_CIFS_HDR_SIZE */ | 305 | memset(temp, 0, 256); /* bigger than MAX_CIFS_HDR_SIZE */ |
306 | 306 | ||
307 | buffer->smb_buf_length = | 307 | buffer->smb_buf_length = cpu_to_be32( |
308 | (2 * word_count) + sizeof(struct smb_hdr) - | 308 | (2 * word_count) + sizeof(struct smb_hdr) - |
309 | 4 /* RFC 1001 length field does not count */ + | 309 | 4 /* RFC 1001 length field does not count */ + |
310 | 2 /* for bcc field itself */ ; | 310 | 2 /* for bcc field itself */) ; |
311 | /* Note that this is the only network field that has to be converted | ||
312 | to big endian and it is done just before we send it */ | ||
313 | 311 | ||
314 | buffer->Protocol[0] = 0xFF; | 312 | buffer->Protocol[0] = 0xFF; |
315 | buffer->Protocol[1] = 'S'; | 313 | buffer->Protocol[1] = 'S'; |
@@ -424,7 +422,7 @@ check_smb_hdr(struct smb_hdr *smb, __u16 mid) | |||
424 | int | 422 | int |
425 | checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) | 423 | checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) |
426 | { | 424 | { |
427 | __u32 len = smb->smb_buf_length; | 425 | __u32 len = be32_to_cpu(smb->smb_buf_length); |
428 | __u32 clc_len; /* calculated length */ | 426 | __u32 clc_len; /* calculated length */ |
429 | cFYI(0, "checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len); | 427 | cFYI(0, "checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len); |
430 | 428 | ||
@@ -464,7 +462,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) | |||
464 | 462 | ||
465 | if (check_smb_hdr(smb, mid)) | 463 | if (check_smb_hdr(smb, mid)) |
466 | return 1; | 464 | return 1; |
467 | clc_len = smbCalcSize_LE(smb); | 465 | clc_len = smbCalcSize(smb); |
468 | 466 | ||
469 | if (4 + len != length) { | 467 | if (4 + len != length) { |
470 | cERROR(1, "Length read does not match RFC1001 length %d", | 468 | cERROR(1, "Length read does not match RFC1001 length %d", |
@@ -521,7 +519,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
521 | (struct smb_com_transaction_change_notify_rsp *)buf; | 519 | (struct smb_com_transaction_change_notify_rsp *)buf; |
522 | struct file_notify_information *pnotify; | 520 | struct file_notify_information *pnotify; |
523 | __u32 data_offset = 0; | 521 | __u32 data_offset = 0; |
524 | if (get_bcc_le(buf) > sizeof(struct file_notify_information)) { | 522 | if (get_bcc(buf) > sizeof(struct file_notify_information)) { |
525 | data_offset = le32_to_cpu(pSMBr->DataOffset); | 523 | data_offset = le32_to_cpu(pSMBr->DataOffset); |
526 | 524 | ||
527 | pnotify = (struct file_notify_information *) | 525 | pnotify = (struct file_notify_information *) |