cifs: remove rfc1002 header from smb2_query_directory_req
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com> Acked-by: Pavel Shilovsky <pshilov@microsoft.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
This commit is contained in:
parent
2fc803efe6
commit
7c00c3a625
|
@ -2993,13 +2993,15 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
|
||||||
unsigned int output_size = CIFSMaxBufSize;
|
unsigned int output_size = CIFSMaxBufSize;
|
||||||
size_t info_buf_size;
|
size_t info_buf_size;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
unsigned int total_len;
|
||||||
|
|
||||||
if (ses && (ses->server))
|
if (ses && (ses->server))
|
||||||
server = ses->server;
|
server = ses->server;
|
||||||
else
|
else
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
rc = small_smb2_init(SMB2_QUERY_DIRECTORY, tcon, (void **) &req);
|
rc = smb2_plain_req_init(SMB2_QUERY_DIRECTORY, tcon, (void **) &req,
|
||||||
|
&total_len);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -3031,7 +3033,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
|
||||||
memcpy(bufptr, &asteriks, len);
|
memcpy(bufptr, &asteriks, len);
|
||||||
|
|
||||||
req->FileNameOffset =
|
req->FileNameOffset =
|
||||||
cpu_to_le16(sizeof(struct smb2_query_directory_req) - 1 - 4);
|
cpu_to_le16(sizeof(struct smb2_query_directory_req) - 1);
|
||||||
req->FileNameLength = cpu_to_le16(len);
|
req->FileNameLength = cpu_to_le16(len);
|
||||||
/*
|
/*
|
||||||
* BB could be 30 bytes or so longer if we used SMB2 specific
|
* BB could be 30 bytes or so longer if we used SMB2 specific
|
||||||
|
@ -3042,15 +3044,13 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
|
||||||
req->OutputBufferLength = cpu_to_le32(output_size);
|
req->OutputBufferLength = cpu_to_le32(output_size);
|
||||||
|
|
||||||
iov[0].iov_base = (char *)req;
|
iov[0].iov_base = (char *)req;
|
||||||
/* 4 for RFC1001 length and 1 for Buffer */
|
/* 1 for Buffer */
|
||||||
iov[0].iov_len = get_rfc1002_length(req) + 4 - 1;
|
iov[0].iov_len = total_len - 1;
|
||||||
|
|
||||||
iov[1].iov_base = (char *)(req->Buffer);
|
iov[1].iov_base = (char *)(req->Buffer);
|
||||||
iov[1].iov_len = len;
|
iov[1].iov_len = len;
|
||||||
|
|
||||||
inc_rfc1001_len(req, len - 1 /* Buffer */);
|
rc = smb2_send_recv(xid, ses, iov, 2, &resp_buftype, flags, &rsp_iov);
|
||||||
|
|
||||||
rc = SendReceive2(xid, ses, iov, 2, &resp_buftype, flags, &rsp_iov);
|
|
||||||
cifs_small_buf_release(req);
|
cifs_small_buf_release(req);
|
||||||
rsp = (struct smb2_query_directory_rsp *)rsp_iov.iov_base;
|
rsp = (struct smb2_query_directory_rsp *)rsp_iov.iov_base;
|
||||||
|
|
||||||
|
|
|
@ -942,7 +942,7 @@ struct smb2_echo_rsp {
|
||||||
#define SMB2_REOPEN 0x10
|
#define SMB2_REOPEN 0x10
|
||||||
|
|
||||||
struct smb2_query_directory_req {
|
struct smb2_query_directory_req {
|
||||||
struct smb2_hdr hdr;
|
struct smb2_sync_hdr sync_hdr;
|
||||||
__le16 StructureSize; /* Must be 33 */
|
__le16 StructureSize; /* Must be 33 */
|
||||||
__u8 FileInformationClass;
|
__u8 FileInformationClass;
|
||||||
__u8 Flags;
|
__u8 Flags;
|
||||||
|
|
Loading…
Reference in New Issue