[PATCH] Improve performance of POSIX open - request query disk id open context

Steve French smfrench at gmail.com
Sat Jul 6 19:43:15 UTC 2019


minor updates to incorporate Pavel's suggestions


On Sat, Jul 6, 2019 at 11:34 AM Pavel Shilovsky
<pavel.shilovsky at gmail.com> wrote:
>
> Good idea! See some comments below.
>
> When adding new context, the following defines need to be changed:
>
> 689 /*
> 690  * Maximum size of a SMB2_CREATE response is 64 (smb2 header) +
> 691  * 88 (fixed part of create response) + 520 (path) + 150 (contexts) +
> 692  * 2 bytes of padding.
> 693  */
> 694 #define MAX_SMB2_CREATE_RESPONSE_SIZE 824
>
> and
>
> 657 /*
> 658  * Maximum number of iovs we need for an open/create request.
> 659  * [0] : struct smb2_create_req
> 660  * [1] : path
> 661  * [2] : lease context
> 662  * [3] : durable context
> 663  * [4] : posix context
> 664  * [5] : time warp context
> 665  * [6] : compound padding
> 666  */
> 667 #define SMB2_CREATE_IOV_SIZE 7
>
> +       if (n_iov > 2) {
> +               struct create_context *ccontext =
> +                       (struct create_context *)iov[n_iov-1].iov_base;
> +               ccontext->Next = cpu_to_le32(iov[n_iov-1].iov_len);
> +       }
> +       add_query_id_context(iov, &n_iov);
>
> I think we should add a check if iov has enough capacity to keep all
> the contexts. Right now it will oops if it wasn't allocated right in
> the upper layer.
>
> In general, I think having a complete patch that adds the whole
> functionality is better for future git bisect and looks more logical
> instead of breaking such small features into parts.
>
> Best regards,
> Pavel Shilovskiy
>
> пт, 5 июл. 2019 г. в 23:14, Steve French via samba-technical
> <samba-technical at lists.samba.org>:
> >
> > We can cut the number of roundtrips on open (may also
> > help some rename cases as well) by returning the inode
> > number in the SMB2 open request itself instead of
> > querying it afterwards via a query FILE_INTERNAL_INFO.
> > This should significantly improve the performance of
> > posix open.
> >
> > Add SMB2_CREATE_QUERY_ON_DISK_ID create context request
> > on open calls so that when server supports this we
> > can save a roundtrip for QUERY_INFO on every open.
> >
> > Follow on patch will add the response processing for
> > SMB2_CREATE_QUERY_ON_DISK_ID context and optimize
> > smb2_open_file to avoid the extra network roundtrip
> > on every posix open. This patch adds the context on
> > SMB2/SMB3 open requests.
> >
> > --
> > Thanks,
> >
> > Steve



-- 
Thanks,

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-SMB3-query-inode-number-on-open-via-create-context.patch
Type: text/x-patch
Size: 4485 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190706/ba128414/0001-SMB3-query-inode-number-on-open-via-create-context.bin>


More information about the samba-technical mailing list