From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385317; b=CLESIq2N4sf628vo8bKrgmopDDrRB/Xx2HZXFKHycg7dh6S5BwIME3tW0RRKDsrYEF/v Os1wQU5uZp0+7bZeJFBipFELaqBuK06pMCq6TYw9q6WsIG6V2LPoa5A8I/v5h8UuS4b6t t5yZrPzfmVMtS0IEQK1t+RSdbVjUHFdsAMfovw9sQHj4dbpI21OQUfygOdCHCQQoS6kSW 5LHPv1auNBL3KtE7KpTj5ntFyf8c1y/awtFJ6Dr6/7R3LyTDjD8kjdIzZUmGgJvStCu8g YngFM8fmEIOcShZJ8JLXIy1cNDS9YjBNOUGNQA1P4u8rZ5oPPqDgKRJ34s/52w4oJNg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385317; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=LVwdOUPYiE5Nsp6GRN8Ap7nuPmZDTB1ucDqEAY4Lyak=; b=BMI28WadZmYV9hse5GJ43uyNxZ26wPZux0OpJGgni3rUdV9Dv8vg06PX1tekLy1YEJou pQU+y/Q+7ECG6ZToCtK/3SkJTVO65WwiQKvF3og6PvXGDBmXW5mompARjdPNvH1EOA4Yw kwI/rNNrNw/oFNINsO085OQNrbuquLpY9/mABU6xjzIW6wm7FKkL7zI+YW7JnlgdxLJbx hwjxKd/6DJ+x5Hi2mOuBodqEzIphrMsoCl6GooXWF9woSTXISUgnQ5JgtyjWRQZzbM4+t y0X4iYGRWC9ZDZaxQZlfEIRTLliBeQax4YiJNc4H2MFf7pdXu9a8kqJ84tjMwKJ1dFw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="yN/h+Bj0"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77AAB606A322; Fri, 4 Dec 2026 11:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yN/h+Bj0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0F291F000CE; Fri, 4 Dec 2026 11:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385317; bh=LVwdOUPYiE5Nsp6GRN8Ap7nuPmZDTB1ucDqEAY4Lyak=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yN/h+Bj0VMh/nBIR/oEfjLQPHg9Re4IWhJb2gbvokRYCZaz6btam+3hYLVMGnQUem QeXlPsgOW/zQM1nYTzVCBlh49obGfCU1IsZIpvC0Lkj8b+8qOGevO/Ua0vxVzqsTkI P1OnhmHESWqq/D6+HIDAo0sgA3d7nuXn3ozsJBOw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Avi Weiss , "Christian Brauner (Amutable)" Subject: [PATCH 6.6 0499/1167] splice, net: avoid MSG_MORE when the bvec array fills Date: Fri, 4 Dec 2026 18:58:46 +0900 Message-ID: <20261204100715.062479032@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Avi Weiss commit 8eaa35c6c29ae669949f4b5b0814c3d34c8ed658 upstream. splice_to_socket() leaves tail at the last included pipe buffer when its 16-entry bvec array fills. If the requested length exceeds the available pipe data, pipe_occupancy() counts that buffer again and sets MSG_MORE even though the pipe is empty. Small TCP transfers can then be delayed until the cork timeout expires. Advance tail before checking the array limit so the occupancy test counts only pipe buffers that have not been included in the send. Fixes: ca2d49f77ce4 ("splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page") Cc: stable@vger.kernel.org Signed-off-by: Avi Weiss Link: https://patch.msgid.link/20261031095922.3577591-2-thnkslprpt@gmail.com Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Greg Kroah-Hartman --- fs/splice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/splice.c +++ b/fs/splice.c @@ -860,9 +860,9 @@ ssize_t splice_to_socket(struct pipe_ino bvec_set_page(&bvec[bc++], buf->page, seg, buf->offset); remain -= seg; + tail++; if (remain == 0 || bc >= ARRAY_SIZE(bvec)) break; - tail++; } if (!bc)