cifs: fill TRANS2_QUERY_FILE_INFO ByteCount fields
Currently the trans2 ByteCount field is incorrectly left zero in TRANS2_QUERY_FILE_INFO info_level=SMB_QUERY_FILE_ALL_INFO and info_level=SMB_QUERY_FILE_UNIX_BASIC requests. The field should properly reflect the FID, information_level and padding bytes carried in these requests. Leaving this field zero causes such requests to fail against Novell CIFS servers. Other SMB servers (e.g. Samba) use the parameter count fields for data length calculations instead, so do not suffer the same fate. Signed-off-by: David Disseldorp <ddiss@suse.de> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:
parent
50285882fd
commit
7ac0febb81
1 changed files with 2 additions and 0 deletions
|
@ -3930,6 +3930,7 @@ CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
|
||||||
pSMB->Pad = 0;
|
pSMB->Pad = 0;
|
||||||
pSMB->Fid = netfid;
|
pSMB->Fid = netfid;
|
||||||
inc_rfc1001_len(pSMB, byte_count);
|
inc_rfc1001_len(pSMB, byte_count);
|
||||||
|
pSMB->t2.ByteCount = cpu_to_le16(byte_count);
|
||||||
|
|
||||||
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
|
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
|
||||||
(struct smb_hdr *) pSMBr, &bytes_returned, 0);
|
(struct smb_hdr *) pSMBr, &bytes_returned, 0);
|
||||||
|
@ -4098,6 +4099,7 @@ CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
|
||||||
pSMB->Pad = 0;
|
pSMB->Pad = 0;
|
||||||
pSMB->Fid = netfid;
|
pSMB->Fid = netfid;
|
||||||
inc_rfc1001_len(pSMB, byte_count);
|
inc_rfc1001_len(pSMB, byte_count);
|
||||||
|
pSMB->t2.ByteCount = cpu_to_le16(byte_count);
|
||||||
|
|
||||||
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
|
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
|
||||||
(struct smb_hdr *) pSMBr, &bytes_returned, 0);
|
(struct smb_hdr *) pSMBr, &bytes_returned, 0);
|
||||||
|
|
Loading…
Reference in a new issue