From patchwork Tue Jul 19 10:33:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 988582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6JAXcVh008034 for ; Tue, 19 Jul 2011 10:33:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481Ab1GSKdF (ORCPT ); Tue, 19 Jul 2011 06:33:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24796 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750954Ab1GSKdD (ORCPT ); Tue, 19 Jul 2011 06:33:03 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6JAWxx1030206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Jul 2011 06:32:59 -0400 Received: from redhat.com (dhcp-1-35.tlv.redhat.com [10.35.1.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id p6JAWjCD030309; Tue, 19 Jul 2011 06:32:46 -0400 Date: Tue, 19 Jul 2011 13:33:16 +0300 From: "Michael S. Tsirkin" To: mashirle@us.ibm.com Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC] vhost: fix zcopy reference counting Message-ID: <20110719103316.GA5376@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Jul 2011 10:33:38 +0000 (UTC) Fix get/put refcount imbalance with zero copy, which caused qemu to hang forever on guest driver unload. Signed-off-by: Michael S. Tsirkin --- Dave, I've put this on my tree so no need for you to bother. drivers/vhost/vhost.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 46822c0..c16d225 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1578,7 +1578,6 @@ struct vhost_ubuf_ref *vhost_ubuf_alloc(struct vhost_virtqueue *vq, if (!ubufs) return ERR_PTR(-ENOMEM); kref_init(&ubufs->kref); - kref_get(&ubufs->kref); init_waitqueue_head(&ubufs->wait); ubufs->vq = vq; return ubufs;