From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 9D4DC1B113 for ; Wed, 24 Oct 2018 12:51:23 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F00BDC058CA0; Wed, 24 Oct 2018 10:51:22 +0000 (UTC) Received: from [10.36.112.57] (ovpn-112-57.ams2.redhat.com [10.36.112.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC04F17B1B; Wed, 24 Oct 2018 10:51:11 +0000 (UTC) To: Tiwei Bie , zhihong.wang@intel.com, dev@dpdk.org References: <20181024093948.9539-1-tiwei.bie@intel.com> From: Maxime Coquelin Message-ID: Date: Wed, 24 Oct 2018 12:51:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181024093948.9539-1-tiwei.bie@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 24 Oct 2018 10:51:23 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] vhost: initialize postcopy ufd properly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 10:51:24 -0000 On 10/24/18 11:39 AM, Tiwei Bie wrote: > Currently, postcopy_ufd is initialized to 0 implicitly, so fd 0 > could be closed unexpectedly by vhost_backend_cleanup(). Fix this > issue by initializing postcopy_ufd to -1 explicitly. > > Fixes: 9eefef3b5970 ("vhost: introduce postcopy advise message") > > Signed-off-by: Tiwei Bie > --- > lib/librte_vhost/vhost.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c > index 047ee535c..70ac6bc9c 100644 > --- a/lib/librte_vhost/vhost.c > +++ b/lib/librte_vhost/vhost.c > @@ -344,6 +344,7 @@ vhost_new_device(void) > dev->flags = VIRTIO_DEV_BUILTIN_VIRTIO_NET; > dev->slave_req_fd = -1; > dev->vdpa_dev_id = -1; > + dev->postcopy_ufd = -1; > rte_spinlock_init(&dev->slave_req_lock); > > return i; > Applied to dpdk-next-virtio/master. Thanks, Maxime