From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:50722 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbeDYKdv (ORCPT ); Wed, 25 Apr 2018 06:33:51 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Long Li , Steve French , Ronnie Sahlberg Subject: [PATCH 4.16 01/26] cifs: smbd: Check for iov length on sending the last iov Date: Wed, 25 Apr 2018 12:33:10 +0200 Message-Id: <20180425103314.903215581@linuxfoundation.org> In-Reply-To: <20180425103314.842517924@linuxfoundation.org> References: <20180425103314.842517924@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Long Li commit ab60ee7bf9a84954f50a66a3d835860e80f99b7f upstream. 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 Cc: stable@vger.kernel.org Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smbdirect.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -2194,6 +2194,8 @@ int smbd_send(struct smbd_connection *in goto done; } i++; + if (i == rqst->rq_nvec) + break; } start = i; buflen = 0;