diff options
author | Long Li <longli@microsoft.com> | 2020-03-27 05:42:24 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-03-30 00:41:49 +0300 |
commit | f7950cb05d060b00db5e6102261417cef26c5789 (patch) | |
tree | ee1829a8b037ae57a705bb4bfceee416768acf9a /fs/cifs/smbdirect.c | |
parent | edad734c74a4ab6ba8531186054779b2382df3fd (diff) | |
download | linux-f7950cb05d060b00db5e6102261417cef26c5789.tar.xz |
cifs: smbd: Calculate the correct maximum packet size for segmented SMBDirect send/receive
The packet size needs to take account of SMB2 header size and possible
encryption header size. This is only done when signing is used and it is for
RDMA send/receive, not read/write.
Also remove the dead SMBD code in smb2_negotiate_r(w)size.
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smbdirect.c')
-rw-r--r-- | fs/cifs/smbdirect.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 5b1b97e9e0c9..a6ae29b3c4e7 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -2097,8 +2097,7 @@ int smbd_send(struct TCP_Server_Info *server, for (i = 0; i < num_rqst; i++) remaining_data_length += smb_rqst_len(server, &rqst_array[i]); - if (remaining_data_length + sizeof(struct smbd_data_transfer) > - info->max_fragmented_send_size) { + if (remaining_data_length > info->max_fragmented_send_size) { log_write(ERR, "payload size %d > max size %d\n", remaining_data_length, info->max_fragmented_send_size); rc = -EINVAL; |