Received: by 10.223.176.5 with SMTP id f5csp3185727wra; Thu, 1 Feb 2018 12:09:22 -0800 (PST) X-Google-Smtp-Source: AH8x226fLeBw6/WXrSohtgLWzdRGpSIyHpOVjQwwUh4+nay63XaPrjsyZsAPoAi36cQo5kCnjhvs X-Received: by 10.98.219.129 with SMTP id f123mr38407828pfg.51.1517515762308; Thu, 01 Feb 2018 12:09:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517515762; cv=none; d=google.com; s=arc-20160816; b=E8mF8SsElhnx3b95mBvp4wr6m/l7GqJXMCK9FRf4jTNK1O4YqWhcsfy+XZdv4cfhMt QKh78nNrhT2w7vNZ8aouGfr3dv0NvDN982QExMmDmsC1Ry4V6RKN5vLQcN7DZpHpSCFy dMQl2ksEnl8mfJdw3vfbwaKP9PXOK+msgF/1plYBKFALwv5ETB6XrD5jXeeKRL4bid3n HeOUl4q5IuTouvJAsAl5Yhx/KNJ4lUKUSOJggXh0VxvPN3EwbyeLtaeBG8Z8uCQ+xWqW M+WBxD6xp7YC3mJMkD2r58O9Up1pAPvkzAVl87OKCgmzXJRzz5ArjMZrkLC2SYdbQVb1 joPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=2oHODbkBXgXz/FFiGOCyws2fOatR3Kfo/2sOxoOEvR4=; b=pJQsNzMXMXRL6lZ3aMIjKsAxARpJxX8Na1exZ+BjWoEKxwGc038mNEZ53iO5VlQpE2 u8WVXGb0jEavkx/rAitPEEEEDwI1+ANFyA0/jlrcyfX6fE1gJPVepEYFZzNW18Ng20aC KKN1mzL85IJHKEsmrD1wgBwnNiK4R2ngC0woWO/S9lg3EdENt580gBbgr75SucrfCsuL sml3Bx/ZddKZTqOxeaHO+L/Ft/HKb1OthKooDo2EyW6tuBHhL8Duj5ZYZk2V/kQgiIze umV0+RGHMV90klY3qngjgDK2/0xdakT6bcU3fPoUjmZqg2Wdydhymln94dR+N0YHi1tW ThJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=CEWBNBqB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si151558pgb.825.2018.02.01.12.09.07; Thu, 01 Feb 2018 12:09:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=CEWBNBqB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754923AbeBAUID (ORCPT + 99 others); Thu, 1 Feb 2018 15:08:03 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:55390 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754663AbeBAUH5 (ORCPT ); Thu, 1 Feb 2018 15:07:57 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w11K7jKH077701; Thu, 1 Feb 2018 20:07:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=2oHODbkBXgXz/FFiGOCyws2fOatR3Kfo/2sOxoOEvR4=; b=CEWBNBqBGj33ibCLPbtyVCmT0gU4RkrRm1VQQ8z4mp4bwuRIZd/16euzOGLnd9skdRLg wFyMyEzAREM0JTM3KTxn0tViNkaLcFWb3Ius+LA4aeMkMPfkm9fQz3Cdz02FmQVq6cT1 1i13dpFzb9pNzAKRr8v/ZC2L36sR/qQ47HvBp4TEIRSWhodocb8gXsUmA65gyHCEdT3f TvF5Dr0fbE4ddln1cEsv/YWgaz4XR6FsG5Pnb57rvNf6M9UT39OiG3nafhCY/TaWaIGf ol/RUqEGlJN4u50/tDE1n1cnxGODiXZuemiuywwroOJd1clCIKAyi6JMqBS8Let8Byeg Wg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2fuqf3crd6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Feb 2018 20:07:45 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w11K7jHQ011748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Feb 2018 20:07:45 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w11K7e4V024381; Thu, 1 Feb 2018 20:07:41 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Feb 2018 12:07:40 -0800 Subject: Re: [PATCH] xen: fix frontend driver disconnected from xenbus on removal To: Oleksandr Andrushchenko , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: jgross@suse.com, david.vrabel@citrix.com, otubo@redhat.com, Oleksandr Andrushchenko References: <1517475439-10541-1-git-send-email-andr2000@gmail.com> <1517475439-10541-2-git-send-email-andr2000@gmail.com> From: Boris Ostrovsky Message-ID: <3943477e-7768-ceb3-38a3-3a20cb0e3082@oracle.com> Date: Thu, 1 Feb 2018 15:08:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1517475439-10541-2-git-send-email-andr2000@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8792 signatures=668660 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=810 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802010257 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/01/2018 03:57 AM, Oleksandr Andrushchenko wrote: > From: Oleksandr Andrushchenko > > Current xenbus frontend driver removal flow first disconnects > the driver from xenbus and then calls driver's remove callback. > This makes it impossible for the driver to listen to backend's > state changes and synchronize the removal procedure. > > Fix this by removing other end XenBus watches after the > driver's remove callback is called. > > Signed-off-by: Oleksandr Andrushchenko > --- > drivers/xen/xenbus/xenbus_probe.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c > index 74888cacd0b0..9c63cd3f416b 100644 > --- a/drivers/xen/xenbus/xenbus_probe.c > +++ b/drivers/xen/xenbus/xenbus_probe.c > @@ -258,11 +258,11 @@ int xenbus_dev_remove(struct device *_dev) > > DPRINTK("%s", dev->nodename); > > - free_otherend_watch(dev); > - > if (drv->remove) > drv->remove(dev); Is it possible for the watch to fire here? -boris > > + free_otherend_watch(dev); > + > free_otherend_details(dev); > > xenbus_switch_state(dev, XenbusStateClosed);