Received: by 10.223.176.5 with SMTP id f5csp2474264wra; Thu, 1 Feb 2018 00:58:22 -0800 (PST) X-Google-Smtp-Source: AH8x225Atd2lXonk/vSbrSxWZkDT6ZIamcY+LY9qp+AgZQHXgJ1F1RuEXctR5It7BKGUk2PNVGUE X-Received: by 10.99.165.84 with SMTP id r20mr1657199pgu.1.1517475501947; Thu, 01 Feb 2018 00:58:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517475501; cv=none; d=google.com; s=arc-20160816; b=au/zHKdF8Q8LkDWBdzJrA05ncxaDTkSO5fiLpyUCU91yRfpIMBuXpMokpB4VIOIF3f WDQYuJ7mficWzmQuTTgTkxuEJs2iyR5mJLzve44Ouj6hCtptSjZBXUHXqJ9iCb2q8aRx nhmDM/tOi7OWOPUebIXhdj6S6AWBOugpeV3FFLAF7daSUHTahQt1/tXfJyiDYPcpp/1t F/dPYOTS9Qp2HZLAA8dKGZoL6mf5zObIOPQuT323xEs/AWZktL9vvL3WqHbBUqKbLOfU Qs9d5IqIp/mkrJ2E2IUTvBzmVBsZWAZYt9XHUKmGAKZ90NYMRGONJqqHqB3DIR9k1Ait 5PNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=z0swvVid+48EApt0Po85wNfesldxl8UkI6Tkco7fEFA=; b=YQ9e+lTohXMXrAZWxOHvGZaRS0/tc6p1Ec3wI+rNHXiZ33sIWSb3GRxylzxInl1Dzn PRCODUOzq6w14pV1ukAA1isncQxy17Phiis5uJrhKxJO10/WNiu2o2jJQDfkDlENb8Hg h63OIt+fHbKCtrMLwfD6JzLGxOTmWY5YH07dR7RsdF98EKtcfMt6QoKGtPB3Inm89QP/ /od+JYwxPyd2bfmhIlv4LwTKZxBpWe79iOmhvYYyr4zaDD3M5KwYlhgGXnt//JXxOOHw 551CWJ0qiZ2dDvVp64HSZyXYAFHT9UqcpUrRzgokn1xMwjEL3Ct4QQ1dOjp/pwBe0hA+ SKUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LZ6DqJIq; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8-v6si1050020pll.455.2018.02.01.00.58.07; Thu, 01 Feb 2018 00:58:21 -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=@gmail.com header.s=20161025 header.b=LZ6DqJIq; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbeBAI5k (ORCPT + 99 others); Thu, 1 Feb 2018 03:57:40 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:42647 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751509AbeBAI5b (ORCPT ); Thu, 1 Feb 2018 03:57:31 -0500 Received: by mail-lf0-f65.google.com with SMTP id q17so24987919lfa.9 for ; Thu, 01 Feb 2018 00:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z0swvVid+48EApt0Po85wNfesldxl8UkI6Tkco7fEFA=; b=LZ6DqJIqIVh69mpwovYqU9NJKkOF/7B0fbam6MLb65rWEg0ajRKsY8ObHuYWhSe6WG 3YRpFaH3nV48Ye8KymfUMRqZnQdUidU8MQo6wHWdi8vnyWp9hM/pkNZG8OI8CoYXfTTZ EPGVRbrk5QBFUyjLUXjIV//2Radm4xnroFBOa2oeYyp/Fw4/F+2ZWjLcKpuJ3B6bQw/1 ZH5oOaNb3GeE6ivXsA33222M9l4Qhbe4tME86/1mKyqBTiQ3dBmDh3HlNka6FJICZdco YdppiE1Zc8PoTIAUre5VEj25P8m1cBR/DulfckSiQ8YKyrQYgHPQQeRGa4ldu0YtICWZ 3zyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z0swvVid+48EApt0Po85wNfesldxl8UkI6Tkco7fEFA=; b=Rd3VEV4qOyWMDAHYH1VtkhSPiu3KuzcVCT1EudIyUklZifQUtZmxU0CbqBRSvJtHON mNXe3FIf54A6ADJ+pwAwjtQld+fhlovwAzO4QhoDok+ONv3yCjDPeZZ+CL3KUef2czQa QrIBIA7IYzCQ5HWzUfNSFiV/s77707bNhWhKEXgQja38kJictooCwA1mHSC6g9QYWLbC Axl2xR/kQaMts1QpjigccZWUzocS7pFNyzKHCQ0pZoB1QMRweGo2TkeceohRG9yaEKp2 xr7vIvTwDzEUqEfvwUMiD+ZJ7pGLIVqaENyAH+KDyM0w5WF9fcZSbg46iKHoSXCJsIie WhpA== X-Gm-Message-State: AKwxytcZY5zUa52pFbfqjHbmpgc3zfzRa1jlxMjmej6ZeJYxfJgGY0F3 A/H2lKzNb3kf6AZqj2vDygA= X-Received: by 10.25.20.168 with SMTP id 40mr21691949lfu.23.1517475449596; Thu, 01 Feb 2018 00:57:29 -0800 (PST) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id o88sm2586465lfg.84.2018.02.01.00.57.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Feb 2018 00:57:28 -0800 (PST) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: jgross@suse.com, david.vrabel@citrix.com, boris.ostrovsky@oracle.com, otubo@redhat.com, Oleksandr Andrushchenko Subject: [PATCH] xen: fix frontend driver disconnected from xenbus on removal Date: Thu, 1 Feb 2018 10:57:19 +0200 Message-Id: <1517475439-10541-2-git-send-email-andr2000@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517475439-10541-1-git-send-email-andr2000@gmail.com> References: <1517475439-10541-1-git-send-email-andr2000@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + free_otherend_watch(dev); + free_otherend_details(dev); xenbus_switch_state(dev, XenbusStateClosed); -- 2.7.4