From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADCCB44AB7B; Tue, 21 Jul 2026 22:07:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784671657; cv=none; b=apnsteM7fBsa9ZT+Q+zzujieiJVdkwuqskpKIRhutze+X5PXYlE9SOsHr41rJzk97jacYMlmxU5+2cpowWvx5D2BOXP6XmhC1qHo4NWnG27Sm2LV4umDVptNNV/UWO6dhHHEJ9uCeQr2KdidVDVHqu3OVvo3CBImHdAvMl9WtCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784671657; c=relaxed/simple; bh=pnI63PWzUdPPFnJqTxz8c4peYcLPG3M+OdbQdbyw1sw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jqs4ibcUMeY3wl5tBhPZR85KdJiVJBdsADtSTV+qPN5OOCLofUASZh84Y6AQ+KCcqxK3/vyOvtaAvuZhJqVJcJuFSrNRhlZaXW5N4XvSQW5H0CrmrdBFm5GWj1C2yAGs4z/+rci085cCVkpv9Y6pi0FE8GtS1gvWFCE9JsIzwgk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YkbNKIGk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YkbNKIGk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2813A1F000E9; Tue, 21 Jul 2026 22:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784671656; bh=8wdoO8fEQsrwKA3RlIE8SW9Uuzbwdl6jV1bF1ccZcRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YkbNKIGklT+GdLyAb5yAsOVwJZS3aEaVVZkiIELmKZr0o8vwaLNVtZLkaEViM/LNp 7eJUvv4Nm/9sbS1sGnndBLwxLKm1CqJBGmapFhShrTg8Z7okfZaML0UbC01wcqRrrR HqbIUPjGOXPQ6Y3xDACe8bqnoOZlbbgve0lPaFVg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Michael S. Tsirkin" , Xie Yongji , Zhang Tianci , Jason Wang , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Sasha Levin Subject: [PATCH 5.15 329/843] vduse: Requeue failed read to send_list head Date: Tue, 21 Jul 2026 17:19:24 +0200 Message-ID: <20260721152413.419401641@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152405.946368001@linuxfoundation.org> References: <20260721152405.946368001@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhang Tianci [ Upstream commit 373ec43ded742b2f3aecf14731ffe1a57f438f38 ] When copy_to_iter() fails in vduse_dev_read_iter(), put the message back at the head of send_list to preserve FIFO ordering and retry the oldest pending request first. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Reported-by: Michael S. Tsirkin Suggested-by: Xie Yongji Signed-off-by: Zhang Tianci Reviewed-by: Xie Yongji Acked-by: Jason Wang Acked-by: Eugenio Pérez Acked-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-ID: <20260226115550.1814-2-zhangtianci.1997@bytedance.com> Signed-off-by: Sasha Levin --- drivers/vdpa/vdpa_user/vduse_dev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index bd5d78fd926db5..1e9f15608c5c7e 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -171,6 +171,12 @@ static void vduse_enqueue_msg(struct list_head *head, list_add_tail(&msg->list, head); } +static void vduse_enqueue_msg_head(struct list_head *head, + struct vduse_dev_msg *msg) +{ + list_add(&msg->list, head); +} + static void vduse_dev_broken(struct vduse_dev *dev) { struct vduse_dev_msg *msg, *tmp; @@ -331,7 +337,7 @@ static ssize_t vduse_dev_read_iter(struct kiocb *iocb, struct iov_iter *to) spin_lock(&dev->msg_lock); if (ret != size) { ret = -EFAULT; - vduse_enqueue_msg(&dev->send_list, msg); + vduse_enqueue_msg_head(&dev->send_list, msg); goto unlock; } vduse_enqueue_msg(&dev->recv_list, msg); -- 2.53.0