Message ID | 148432790018.21615.8366831585737978346.stgit@bahia (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show
Return-Path: <v9fs-developer-bounces@lists.sourceforge.net> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8797460762 for <patchwork-v9fs-devel@patchwork.kernel.org>; Fri, 13 Jan 2017 21:03:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7853828784 for <patchwork-v9fs-devel@patchwork.kernel.org>; Fri, 13 Jan 2017 21:03:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D07728785; Fri, 13 Jan 2017 21:03:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C19A28781 for <patchwork-v9fs-devel@patchwork.kernel.org>; Fri, 13 Jan 2017 21:03:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from <v9fs-developer-bounces@lists.sourceforge.net>) id 1cS90Q-0003ij-6H; Fri, 13 Jan 2017 21:03:26 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from <groug@kaod.org>) id 1cS90P-0003id-8C for v9fs-developer@lists.sourceforge.net; Fri, 13 Jan 2017 21:03:25 +0000 Received-SPF: softfail (sog-mx-3.v43.ch3.sourceforge.com: transitioning domain of kaod.org does not designate 148.163.156.1 as permitted sender) client-ip=148.163.156.1; envelope-from=groug@kaod.org; helo=mx0a-001b2d01.pphosted.com; Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1cS90O-0008RL-88 for v9fs-developer@lists.sourceforge.net; Fri, 13 Jan 2017 21:03:25 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id v0DHA8dG066569 for <v9fs-developer@lists.sourceforge.net>; Fri, 13 Jan 2017 12:18:29 -0500 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 27y2gdsnb3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for <v9fs-developer@lists.sourceforge.net>; Fri, 13 Jan 2017 12:18:28 -0500 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <v9fs-developer@lists.sourceforge.net> from <groug@kaod.org>; Fri, 13 Jan 2017 10:18:28 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 13 Jan 2017 10:18:23 -0700 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id CCF0B19D8053; Fri, 13 Jan 2017 10:17:39 -0700 (MST) Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0DHINPd10551704; Fri, 13 Jan 2017 10:18:23 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F41AD13603A; Fri, 13 Jan 2017 10:18:22 -0700 (MST) Received: from [192.168.66.23] (unknown [9.164.137.117]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id D8B3F136040; Fri, 13 Jan 2017 10:18:21 -0700 (MST) From: Greg Kurz <groug@kaod.org> To: qemu-devel@nongnu.org Date: Fri, 13 Jan 2017 18:18:20 +0100 User-Agent: StGit/0.17.1-20-gc0b1b-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011317-0024-0000-0000-000015B174AC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006427; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00807183; UDB=6.00392889; IPR=6.00584515; BA=6.00005053; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013911; XFM=3.00000011; UTC=2017-01-13 17:18:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011317-0025-0000-0000-000047EC64FF Message-Id: <148432790018.21615.8366831585737978346.stgit@bahia> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-13_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701130234 X-Headers-End: 1cS90O-0008RL-88 Cc: v9fs-developer@lists.sourceforge.net, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>, Greg Kurz <groug@kaod.org> Subject: [V9fs-developer] [PATCH] 9pfs: fix off-by-one error in PDU free list X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: <v9fs-developer.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/v9fs-developer>, <mailto:v9fs-developer-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=v9fs-developer> List-Post: <mailto:v9fs-developer@lists.sourceforge.net> List-Help: <mailto:v9fs-developer-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/v9fs-developer>, <mailto:v9fs-developer-request@lists.sourceforge.net?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index fa58877570f6..965c8edc8030 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3454,7 +3454,7 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp) /* initialize pdu allocator */ QLIST_INIT(&s->free_list); QLIST_INIT(&s->active_list); - for (i = 0; i < (MAX_REQ - 1); i++) { + for (i = 0; i < MAX_REQ; i++) { QLIST_INSERT_HEAD(&s->free_list, &s->pdus[i], next); s->pdus[i].s = s; s->pdus[i].idx = i;
The server can handle MAX_REQ - 1 PDUs at a time and the virtio-9p device has a MAX_REQ sized virtqueue. If the client manages to fill up the virtqueue, pdu_alloc() will fail and the request won't be processed without any notice to the client (it actually causes the linux 9p client to hang). This has been there since the beginning (commit 9f10751365b2 "virtio-9p: Add a virtio 9p device to qemu"), but it needs an agressive workload to run in the guest to show up. We actually allocate MAX_REQ PDUs and I see no reason not to link them all into the free list, so let's fix the init loop. Reported-by: Tuomas Tynkkynen <tuomas@tuxera.com> Suggested-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Greg Kurz <groug@kaod.org> --- hw/9pfs/9p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi