Re: [PATCH 06/19] cifs: remove rfc1002 header from smb2_ioctl_req

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-11-20 16:04 GMT-08:00 Ronnie Sahlberg <lsahlber@xxxxxxxxxx>:
> Signed-off-by: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
> ---
>  fs/cifs/smb2pdu.c | 22 +++++++++++-----------
>  fs/cifs/smb2pdu.h |  2 +-
>  2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index be68b129c8fa..071e5d57ec6c 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -1912,6 +1912,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
>         int n_iov;
>         int rc = 0;
>         int flags = 0;
> +       unsigned int total_len;
>
>         cifs_dbg(FYI, "SMB2 IOCTL\n");
>
> @@ -1930,7 +1931,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
>         if (!ses || !(ses->server))
>                 return -EIO;
>
> -       rc = small_smb2_init(SMB2_IOCTL, tcon, (void **) &req);
> +       rc = smb2_plain_req_init(SMB2_IOCTL, tcon, (void **) &req, &total_len);
>         if (rc)
>                 return rc;
>
> @@ -1941,8 +1942,8 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
>                 }
>
>                 cifs_dbg(FYI, "replacing tid 0x%x with IPC tid 0x%x\n",
> -                        req->hdr.sync_hdr.TreeId, ses->ipc_tid);
> -               req->hdr.sync_hdr.TreeId = ses->ipc_tid;
> +                        req->sync_hdr.TreeId, ses->ipc_tid);
> +               req->sync_hdr.TreeId = ses->ipc_tid;
>         }
>         if (encryption_required(tcon))
>                 flags |= CIFS_TRANSFORM_REQ;
> @@ -1955,7 +1956,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
>                 req->InputCount = cpu_to_le32(indatalen);
>                 /* do not set InputOffset if no input data */
>                 req->InputOffset =
> -                      cpu_to_le32(offsetof(struct smb2_ioctl_req, Buffer) - 4);
> +                      cpu_to_le32(offsetof(struct smb2_ioctl_req, Buffer));
>                 iov[1].iov_base = in_data;
>                 iov[1].iov_len = indatalen;
>                 n_iov = 2;
> @@ -1990,21 +1991,20 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
>          * but if input data passed to ioctl, we do not
>          * want to double count this, so we do not send
>          * the dummy one byte of data in iovec[0] if sending
> -        * input data (in iovec[1]). We also must add 4 bytes
> -        * in first iovec to allow for rfc1002 length field.
> +        * input data (in iovec[1]).
>          */
>
>         if (indatalen) {
> -               iov[0].iov_len = get_rfc1002_length(req) + 4 - 1;
> -               inc_rfc1001_len(req, indatalen - 1);
> +               iov[0].iov_len = total_len - 1;
>         } else
> -               iov[0].iov_len = get_rfc1002_length(req) + 4;
> +               iov[0].iov_len = total_len;

We should remove square brackets here or even move the code above to
the same if {} else {} block. It can be done through a follow on patch
- no need to fixup this one.

--
Best regards,
Pavel Shilovsky
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux