[Patch v2 1/6] cifs: smbd: Check for iov length on sending the last iov

Steve French smfrench at gmail.com
Tue Apr 17 20:04:47 UTC 2018


merged into cifs-2.6.git for-next

On Tue, Apr 17, 2018 at 2:17 PM, Long Li <longli at linuxonhyperv.com> wrote:

> From: Long Li <longli at microsoft.com>
>
> When sending the last iov that breaks into smaller buffers to fit the
> transfer size, it's necessary to check if this is the last iov.
>
> If this is the latest iov, stop and proceed to send pages.
>
> Signed-off-by: Long Li <longli at microsoft.com>
> Cc: stable at vger.kernel.org
> ---
>  fs/cifs/smbdirect.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
> index 90e673c..b5c6c0d 100644
> --- a/fs/cifs/smbdirect.c
> +++ b/fs/cifs/smbdirect.c
> @@ -2197,6 +2197,8 @@ int smbd_send(struct smbd_connection *info, struct
> smb_rqst *rqst)
>                                                 goto done;
>                                 }
>                                 i++;
> +                               if (i == rqst->rq_nvec)
> +                                       break;
>                         }
>                         start = i;
>                         buflen = 0;
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Thanks,

Steve


More information about the samba-technical mailing list