Received: by 10.192.165.156 with SMTP id m28csp416008imm; Tue, 17 Apr 2018 12:21:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx48JDGPIbro5jGZakBVf49uu7+MSKvvEYfbC+Kknoytm13s3IUYRN/S8i3A4mBlzPgMBe+H2 X-Received: by 10.98.64.201 with SMTP id f70mr3068956pfd.67.1523992866206; Tue, 17 Apr 2018 12:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523992866; cv=none; d=google.com; s=arc-20160816; b=0u9jwSnx6ZhyQjgTcOFzck8Ito5hUmSytaWHz6vTR05RUTCniUkP0oypVJuKFNf6VZ RDIKOji9csu9LPkzwcluPb///Agib1/nAtlSmRN1y0bXwm7YghohMSPW95K/98OTa8eb qc5QdLEpr8UNgmQw0OlnPE7kvFFt+fOMn32m9qdLCUggMK+xKXS4ZAe1AF4rDNK0vWqY 6fHSz/Li5AP/UN/Jqr0X649ZsVVNHdq+TroKCjQjsjZ8zo5N4Aoxtpkmvf+FttOBwTsn eTfQg152X4uYjW9U7iAK59KedwHA3MPWm1sVOb2zIdvHU3XiNTPjiNEIzDPKdzwjm1hQ JG/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:message-id:date:subject:cc:to :from:arc-authentication-results; bh=xKSSNw5wKvfI62LCxk1wkOf7zqnEdN0DF0P08WhtG5o=; b=FiIeNqwtdMHJ1aNiY80ntVCZSEoF5SeXQfsiMrGUup1TwcvGgCWY0Eldb/OfTR4XAS TEwJTRNfVDFK7X3uyAW7ASI5HVPA/DCGRWVMILyDTPp5ueXfXQyF1ybMxxKL/zU313rf IEV9sqIK2NFpb6LXFvj4P9MxNeRKrVpLLITuJcFwYipslR/8dmgtujnbfqlheDEveGTk w21juFEAsaH1T1C1rF9gkwdfZv4nUn6aRvBc80v3LcYsB8uXcTvrwwl0ub29zYUQmGdQ 0tPQr1GguJAhS6cvKTsyBT86OfF5jmIKuDXvyOb7VSxlBu0jSRyRf321NQPH9ZNvtY6R zB6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si12333712pgn.468.2018.04.17.12.20.52; Tue, 17 Apr 2018 12:21:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbeDQTS3 (ORCPT + 99 others); Tue, 17 Apr 2018 15:18:29 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:53544 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbeDQTSZ (ORCPT ); Tue, 17 Apr 2018 15:18:25 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id 8W6LfBbEhRnIx8W6LfCpHy; Tue, 17 Apr 2018 12:17:23 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.89_1) (envelope-from ) id 1f8W6L-0003sJ-5o; Tue, 17 Apr 2018 12:17:13 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Cc: Long Li , stable@vger.kernel.org Subject: [Patch v2 1/6] cifs: smbd: Check for iov length on sending the last iov Date: Tue, 17 Apr 2018 12:17:05 -0700 Message-Id: <20180417191710.14855-1-longli@linuxonhyperv.com> X-Mailer: git-send-email 2.15.1 Reply-To: longli@microsoft.com X-CMAE-Envelope: MS4wfFFyrHmGPBnp8v7gnOzs6TL6+PTuEYW9qQRTRaOW6pLf3JLYL3h7jsKrSwLAQzC8YqNzE9CGqmTR/njE8fC6VlaoYodhbiyOhurJ7kpsxknr1P4Jozj4 TI6M7fL0Qwu8qWHnOmA2z+p/iVzjjNpolxiOqFq2B7CG4rLvnd1x1g0rgplXJCTb5rz3Khx5iTmtSPdyJtPnUkvR5IeEA4fMVmwZhcK36z9K1liePqlnnFgh YKDc6X4LU5Vb3AeVwUIau164vBT6hecDdW/8N1CtAfux16UKu9Piloe2lu998QsUDdLblXvGSSGmO8dpkDn92mpNh0iDykHYawVP77gjquesMPe2kmaD3kKS 0zk6+njtwVzTCIX69y6qLqfBWsWLjvBlDUeqJyf73+gggsE1S0ZyIoxiMm8qGKvcXwJ18G7nuYoKap03O6qa2n19n3tXIi3nAKIFxQ9QyF6CjwJL0vw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li 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 --- 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