* cifs: Update patch based on Pavels feedback
@ 2017-11-20 23:07 Ronnie Sahlberg
[not found] ` <20171120230727.10236-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ronnie Sahlberg @ 2017-11-20 23:07 UTC (permalink / raw)
To: linux-cifs; +Cc: Steve French
There was a bug in the computation of total_len that Pavel reported.
This is the updated patch.
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <20171120230727.10236-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req [not found] ` <20171120230727.10236-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-11-20 23:07 ` Ronnie Sahlberg 0 siblings, 0 replies; 8+ messages in thread From: Ronnie Sahlberg @ 2017-11-20 23:07 UTC (permalink / raw) To: linux-cifs; +Cc: Steve French Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- fs/cifs/smb2pdu.c | 13 ++++++------- fs/cifs/smb2pdu.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index c1dd5961cf3f..5896fcc4c7e4 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3521,34 +3521,33 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, int resp_buf_type; unsigned int count; int flags = CIFS_NO_RESP; + unsigned int total_len; cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock); - rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); + rc = smb2_plain_req_init(SMB2_LOCK, tcon, (void **) &req, &total_len); if (rc) return rc; if (encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - req->hdr.sync_hdr.ProcessId = cpu_to_le32(pid); + req->sync_hdr.ProcessId = cpu_to_le32(pid); req->LockCount = cpu_to_le16(num_lock); req->PersistentFileId = persist_fid; req->VolatileFileId = volatile_fid; count = num_lock * sizeof(struct smb2_lock_element); - inc_rfc1001_len(req, count - sizeof(struct smb2_lock_element)); iov[0].iov_base = (char *)req; - /* 4 for rfc1002 length field and count for all locks */ - iov[0].iov_len = get_rfc1002_length(req) + 4 - count; + iov[0].iov_len = total_len - sizeof(struct smb2_lock_element); iov[1].iov_base = (char *)buf; iov[1].iov_len = count; cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); - rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, flags, - &rsp_iov); + rc = smb2_send_recv(xid, tcon->ses, iov, 2, &resp_buf_type, flags, + &rsp_iov); cifs_small_buf_release(req); if (rc) { cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc); diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index a8102e5f4ebb..0c33fc8cce71 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -907,7 +907,7 @@ struct smb2_lock_element { } __packed; struct smb2_lock_req { - struct smb2_hdr hdr; + struct smb2_sync_hdr sync_hdr; __le16 StructureSize; /* Must be 48 */ __le16 LockCount; __le32 Reserved; -- 2.13.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 00/19 Version 4] cifs: remove rfc1002 from smb2 requests
@ 2017-11-21 0:04 Ronnie Sahlberg
[not found] ` <20171121000442.24888-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ronnie Sahlberg @ 2017-11-21 0:04 UTC (permalink / raw)
To: linux-cifs; +Cc: Steve French
Steve, All,
Please find an updated version of the patch series to get rid of the
rfc1002 header from all request structures in SMB2.
Version 2:
* changed SendReceive3 to smb2_send_recv
* fixed a Buffer[1] error that aaptel@xxxxxxxx reported
Version 3:
* Change SMB2_read() to use smb2_send_recv instead of cifs_send_recv
* Fix smb2_negotiate_req where we didnt update the total length to
accomodate smb2 contexts.
* Fix smb2_lease_ack where I forgot to bump total length by 12.
Version 4:
* Fix incorrect length in smb2_lockv
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <20171121000442.24888-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req [not found] ` <20171121000442.24888-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-11-21 0:04 ` Ronnie Sahlberg 0 siblings, 0 replies; 8+ messages in thread From: Ronnie Sahlberg @ 2017-11-21 0:04 UTC (permalink / raw) To: linux-cifs; +Cc: Steve French Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- fs/cifs/smb2pdu.c | 13 ++++++------- fs/cifs/smb2pdu.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index c1dd5961cf3f..5896fcc4c7e4 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3521,34 +3521,33 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, int resp_buf_type; unsigned int count; int flags = CIFS_NO_RESP; + unsigned int total_len; cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock); - rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); + rc = smb2_plain_req_init(SMB2_LOCK, tcon, (void **) &req, &total_len); if (rc) return rc; if (encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - req->hdr.sync_hdr.ProcessId = cpu_to_le32(pid); + req->sync_hdr.ProcessId = cpu_to_le32(pid); req->LockCount = cpu_to_le16(num_lock); req->PersistentFileId = persist_fid; req->VolatileFileId = volatile_fid; count = num_lock * sizeof(struct smb2_lock_element); - inc_rfc1001_len(req, count - sizeof(struct smb2_lock_element)); iov[0].iov_base = (char *)req; - /* 4 for rfc1002 length field and count for all locks */ - iov[0].iov_len = get_rfc1002_length(req) + 4 - count; + iov[0].iov_len = total_len - sizeof(struct smb2_lock_element); iov[1].iov_base = (char *)buf; iov[1].iov_len = count; cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); - rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, flags, - &rsp_iov); + rc = smb2_send_recv(xid, tcon->ses, iov, 2, &resp_buf_type, flags, + &rsp_iov); cifs_small_buf_release(req); if (rc) { cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc); diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index a8102e5f4ebb..0c33fc8cce71 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -907,7 +907,7 @@ struct smb2_lock_element { } __packed; struct smb2_lock_req { - struct smb2_hdr hdr; + struct smb2_sync_hdr sync_hdr; __le16 StructureSize; /* Must be 48 */ __le16 LockCount; __le32 Reserved; -- 2.13.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 00/10] cifs: Remove rfc1002 header from smb2 request structs
@ 2017-11-20 0:24 Ronnie Sahlberg
[not found] ` <20171120002447.32322-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ronnie Sahlberg @ 2017-11-20 0:24 UTC (permalink / raw)
To: linux-cifs; +Cc: Steve French
Steve, All,
Please find an updated version of the patch series to get rid of the
rfc1002 header from all request structures in SMB2.
Version 2:
* changed SendReceive3 to smb2_send_recv
* fixed a Buffer[1] error that aaptel-IBi9RG/b67k@public.gmane.org reported
Version 3:
* Change SMB2_read() to use smb2_send_recv instead of cifs_send_recv
* Fix smb2_negotiate_req where we didnt update the total length to
accomodate smb2 contexts.
* Fix smb2_lease_ack where I forgot to bump total length by 12.
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <20171120002447.32322-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req [not found] ` <20171120002447.32322-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-11-20 0:24 ` Ronnie Sahlberg [not found] ` <20171120002447.32322-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Ronnie Sahlberg @ 2017-11-20 0:24 UTC (permalink / raw) To: linux-cifs; +Cc: Steve French Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- fs/cifs/smb2pdu.c | 13 ++++++------- fs/cifs/smb2pdu.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index c1dd5961cf3f..d1242b1c9c35 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3521,34 +3521,33 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, int resp_buf_type; unsigned int count; int flags = CIFS_NO_RESP; + unsigned int total_len; cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock); - rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); + rc = smb2_plain_req_init(SMB2_LOCK, tcon, (void **) &req, &total_len); if (rc) return rc; if (encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - req->hdr.sync_hdr.ProcessId = cpu_to_le32(pid); + req->sync_hdr.ProcessId = cpu_to_le32(pid); req->LockCount = cpu_to_le16(num_lock); req->PersistentFileId = persist_fid; req->VolatileFileId = volatile_fid; count = num_lock * sizeof(struct smb2_lock_element); - inc_rfc1001_len(req, count - sizeof(struct smb2_lock_element)); iov[0].iov_base = (char *)req; - /* 4 for rfc1002 length field and count for all locks */ - iov[0].iov_len = get_rfc1002_length(req) + 4 - count; + iov[0].iov_len = total_len; iov[1].iov_base = (char *)buf; iov[1].iov_len = count; cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); - rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, flags, - &rsp_iov); + rc = smb2_send_recv(xid, tcon->ses, iov, 2, &resp_buf_type, flags, + &rsp_iov); cifs_small_buf_release(req); if (rc) { cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc); diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index a8102e5f4ebb..0c33fc8cce71 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -907,7 +907,7 @@ struct smb2_lock_element { } __packed; struct smb2_lock_req { - struct smb2_hdr hdr; + struct smb2_sync_hdr sync_hdr; __le16 StructureSize; /* Must be 48 */ __le16 LockCount; __le32 Reserved; -- 2.13.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
[parent not found: <20171120002447.32322-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req [not found] ` <20171120002447.32322-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-11-20 22:56 ` Pavel Shilovsky 0 siblings, 0 replies; 8+ messages in thread From: Pavel Shilovsky @ 2017-11-20 22:56 UTC (permalink / raw) To: Ronnie Sahlberg; +Cc: linux-cifs, Steve French 2017-11-19 16:24 GMT-08:00 Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>: > Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > --- > fs/cifs/smb2pdu.c | 13 ++++++------- > fs/cifs/smb2pdu.h | 2 +- > 2 files changed, 7 insertions(+), 8 deletions(-) > > diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c > index c1dd5961cf3f..d1242b1c9c35 100644 > --- a/fs/cifs/smb2pdu.c > +++ b/fs/cifs/smb2pdu.c > @@ -3521,34 +3521,33 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, > int resp_buf_type; > unsigned int count; > int flags = CIFS_NO_RESP; > + unsigned int total_len; > > cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock); > > - rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); > + rc = smb2_plain_req_init(SMB2_LOCK, tcon, (void **) &req, &total_len); > if (rc) > return rc; > > if (encryption_required(tcon)) > flags |= CIFS_TRANSFORM_REQ; > > - req->hdr.sync_hdr.ProcessId = cpu_to_le32(pid); > + req->sync_hdr.ProcessId = cpu_to_le32(pid); > req->LockCount = cpu_to_le16(num_lock); > > req->PersistentFileId = persist_fid; > req->VolatileFileId = volatile_fid; > > count = num_lock * sizeof(struct smb2_lock_element); > - inc_rfc1001_len(req, count - sizeof(struct smb2_lock_element)); StructureSize already has one lock element inside... > > iov[0].iov_base = (char *)req; > - /* 4 for rfc1002 length field and count for all locks */ > - iov[0].iov_len = get_rfc1002_length(req) + 4 - count; > + iov[0].iov_len = total_len; ... which should be accounted here by substracting sizeof(struct smb2_lock_element) from total_len. > iov[1].iov_base = (char *)buf; > iov[1].iov_len = count; This was caught by running cthon tests against the patchset. -- Best regards, Pavel Shilovsky ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 00/19] Remove rfc1002 header from smb2 request structs
@ 2017-11-09 1:14 Ronnie Sahlberg
[not found] ` <20171109011433.14468-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ronnie Sahlberg @ 2017-11-09 1:14 UTC (permalink / raw)
To: linux-cifs; +Cc: Steve French
Steve, All,
Please find an updated version of the patch series to get rid of the
rfc1002 header from all request structures in SMB2.
Version 2:
* changed SendReceive3 to smb2_send_recv
* fixed a Buffer[1] error that aaptel-IBi9RG/b67k@public.gmane.org reported
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <20171109011433.14468-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req [not found] ` <20171109011433.14468-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-11-09 1:14 ` Ronnie Sahlberg [not found] ` <20171109011433.14468-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Ronnie Sahlberg @ 2017-11-09 1:14 UTC (permalink / raw) To: linux-cifs; +Cc: Steve French Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- fs/cifs/smb2pdu.c | 13 ++++++------- fs/cifs/smb2pdu.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 144395bab5c1..a44d54ea946b 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3515,34 +3515,33 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, int resp_buf_type; unsigned int count; int flags = CIFS_NO_RESP; + unsigned int total_len; cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock); - rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); + rc = smb2_plain_req_init(SMB2_LOCK, tcon, (void **) &req, &total_len); if (rc) return rc; if (encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - req->hdr.sync_hdr.ProcessId = cpu_to_le32(pid); + req->sync_hdr.ProcessId = cpu_to_le32(pid); req->LockCount = cpu_to_le16(num_lock); req->PersistentFileId = persist_fid; req->VolatileFileId = volatile_fid; count = num_lock * sizeof(struct smb2_lock_element); - inc_rfc1001_len(req, count - sizeof(struct smb2_lock_element)); iov[0].iov_base = (char *)req; - /* 4 for rfc1002 length field and count for all locks */ - iov[0].iov_len = get_rfc1002_length(req) + 4 - count; + iov[0].iov_len = total_len; iov[1].iov_base = (char *)buf; iov[1].iov_len = count; cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); - rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, flags, - &rsp_iov); + rc = smb2_send_recv(xid, tcon->ses, iov, 2, &resp_buf_type, flags, + &rsp_iov); cifs_small_buf_release(req); if (rc) { cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc); diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index a8102e5f4ebb..0c33fc8cce71 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -907,7 +907,7 @@ struct smb2_lock_element { } __packed; struct smb2_lock_req { - struct smb2_hdr hdr; + struct smb2_sync_hdr sync_hdr; __le16 StructureSize; /* Must be 48 */ __le16 LockCount; __le32 Reserved; -- 2.13.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
[parent not found: <20171109011433.14468-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req [not found] ` <20171109011433.14468-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-11-09 14:11 ` Aurélien Aptel 0 siblings, 0 replies; 8+ messages in thread From: Aurélien Aptel @ 2017-11-09 14:11 UTC (permalink / raw) To: Ronnie Sahlberg, linux-cifs; +Cc: Steve French Reviewed-by: Aurelien Aptel <aaptel-IBi9RG/b67k@public.gmane.org> -- Aurélien Aptel / SUSE Labs Samba Team GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3 SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 00/19] cifs: remove rfc1002 header from all smb2 requests
@ 2017-11-02 7:02 Ronnie Sahlberg
[not found] ` <20171102070312.18903-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ronnie Sahlberg @ 2017-11-02 7:02 UTC (permalink / raw)
To: linux-cifs; +Cc: Steve French
Steve, all
I split the !1002 patch into a small serie for easier review.
This patch series removes the NBSS 4 byte header from all the
smb2 request structures.
Instead of computing and tweaking the header as part of composing
the SMB2 request, we now compute it in the new SendReceive3() function
that is used by all of SMB2.
This eliminates a huge amount of magic +4 / -4 in the code
and all the ugly inc_rfc1002.... stuff where the old code would
constantly tweak the length field as it was building the PDU.
So overall it also simplifies the code in some places I think.
This series is to prepare for and make it easier to add smb2 compounding
in the future as then we will need to construct multiple SMB2 pdus
and wrap them all insode one single rfc1002 header.
As a later series, before we get to the actual compounding, I plan to
do a similar change to all the reply structures and remove the rfc1002
header from them all too.
Please review, and test.
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <20171102070312.18903-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req [not found] ` <20171102070312.18903-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2017-11-02 7:03 ` Ronnie Sahlberg 0 siblings, 0 replies; 8+ messages in thread From: Ronnie Sahlberg @ 2017-11-02 7:03 UTC (permalink / raw) To: linux-cifs; +Cc: Steve French Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- fs/cifs/smb2pdu.c | 11 +++++------ fs/cifs/smb2pdu.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index b49e0028cf4f..5dc0ec2cad1e 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3513,33 +3513,32 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, int resp_buf_type; unsigned int count; int flags = CIFS_NO_RESP; + unsigned int total_len; cifs_dbg(FYI, "smb2_lockv num lock %d\n", num_lock); - rc = small_smb2_init(SMB2_LOCK, tcon, (void **) &req); + rc = smb2_plain_req_init(SMB2_LOCK, tcon, (void **) &req, &total_len); if (rc) return rc; if (encryption_required(tcon)) flags |= CIFS_TRANSFORM_REQ; - req->hdr.sync_hdr.ProcessId = cpu_to_le32(pid); + req->sync_hdr.ProcessId = cpu_to_le32(pid); req->LockCount = cpu_to_le16(num_lock); req->PersistentFileId = persist_fid; req->VolatileFileId = volatile_fid; count = num_lock * sizeof(struct smb2_lock_element); - inc_rfc1001_len(req, count - sizeof(struct smb2_lock_element)); iov[0].iov_base = (char *)req; - /* 4 for rfc1002 length field and count for all locks */ - iov[0].iov_len = get_rfc1002_length(req) + 4 - count; + iov[0].iov_len = total_len; iov[1].iov_base = (char *)buf; iov[1].iov_len = count; cifs_stats_inc(&tcon->stats.cifs_stats.num_locks); - rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, flags, + rc = SendReceive3(xid, tcon->ses, iov, 2, &resp_buf_type, flags, &rsp_iov); cifs_small_buf_release(req); if (rc) { diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index a8102e5f4ebb..0c33fc8cce71 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -907,7 +907,7 @@ struct smb2_lock_element { } __packed; struct smb2_lock_req { - struct smb2_hdr hdr; + struct smb2_sync_hdr sync_hdr; __le16 StructureSize; /* Must be 48 */ __le16 LockCount; __le32 Reserved; -- 2.13.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-11-21 0:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 23:07 cifs: Update patch based on Pavels feedback Ronnie Sahlberg
[not found] ` <20171120230727.10236-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-20 23:07 ` [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req Ronnie Sahlberg
-- strict thread matches above, loose matches on Subject: below --
2017-11-21 0:04 [PATCH 00/19 Version 4] cifs: remove rfc1002 from smb2 requests Ronnie Sahlberg
[not found] ` <20171121000442.24888-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-21 0:04 ` [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req Ronnie Sahlberg
2017-11-20 0:24 [PATCH 00/10] cifs: Remove rfc1002 header from smb2 request structs Ronnie Sahlberg
[not found] ` <20171120002447.32322-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-20 0:24 ` [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req Ronnie Sahlberg
[not found] ` <20171120002447.32322-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-20 22:56 ` Pavel Shilovsky
2017-11-09 1:14 [PATCH 00/19] Remove rfc1002 header from smb2 request structs Ronnie Sahlberg
[not found] ` <20171109011433.14468-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-09 1:14 ` [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req Ronnie Sahlberg
[not found] ` <20171109011433.14468-13-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-09 14:11 ` Aurélien Aptel
2017-11-02 7:02 [PATCH 00/19] cifs: remove rfc1002 header from all smb2 requests Ronnie Sahlberg
[not found] ` <20171102070312.18903-1-lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-11-02 7:03 ` [PATCH 12/19] cifs: remove rfc1002 header from smb2_lock_req Ronnie Sahlberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox