From patchwork Tue May 31 08:59:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Liu X-Patchwork-Id: 9143861 Return-Path: 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 0857160757 for ; Tue, 31 May 2016 09:02:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F114928187 for ; Tue, 31 May 2016 09:02:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E37EF27BF1; Tue, 31 May 2016 09:02:31 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5209627BF1 for ; Tue, 31 May 2016 09:02:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7fWq-0005kc-6F; Tue, 31 May 2016 09:00:00 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7fWp-0005kV-KT for xen-devel@lists.xenproject.org; Tue, 31 May 2016 08:59:59 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id B8/D1-27700-E825D475; Tue, 31 May 2016 08:59:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsUyZ7p8oG5fkG+ 4wdJjPBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa0bP7gtsBVPZKloarjA2MC5j7WLk4hASaGOS mPN/JjOE841R4vT6vWwQzkZGiaYTP4EynEBOL6PE9tP1XYwcHGwCShLz76eDhEUEFCQ29z5jB QkzC5RJTP4rDBIWFoiX2L19K1gni4CqxPE569lBbF4BJ4n26avA4hICihLdzyawQdiGEqcfbm OcwMizgJFhFaN6cWpRWWqRrpleUlFmekZJbmJmjq6hgalebmpxcWJ6ak5iUrFecn7uJkag1xm AYAfj1AbnQ4ySHExKorxWv33ChfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwJgX6hgsJFqWmp1ak ZeYAww8mLcHBoyTCuwEkzVtckJhbnJkOkTrFqMux4MfttUxCLHn5ealS4rzlIEUCIEUZpXlwI 2CxcIlRVkqYlxHoKCGegtSi3MwSVPlXjOIcjErCvJtApvBk5pXAbXoFdAQT0BHxGT4gR5QkIq SkGhin2UVecX7lG777eLnEtz3trnNffzH027w0fp2dx5nVUbu1FZmiM/g69rRZrPtgrBydd3b H3F8+XZNP5++yL+17zME/UWfJYbvdZ667Cm/cJyfzxD3ZMq8odn5QxbqLF3jiLDX2NXBs+Li4 6vKLXqvGhsWMbHzB5WaL2wsOlbrc3+r4QVn77n8lluKMREMt5qLiRACYnEBHgAIAAA== X-Env-Sender: bob.liu@oracle.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1464685196!6010922!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3205 invoked from network); 31 May 2016 08:59:57 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 31 May 2016 08:59:57 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u4V8xprp022384 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 31 May 2016 08:59:51 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u4V8xo3f010597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 31 May 2016 08:59:51 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u4V8xjF4023705; Tue, 31 May 2016 08:59:46 GMT Received: from boliuliu.jp.oracle.com (/10.191.11.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 31 May 2016 01:59:45 -0700 From: Bob Liu To: linux-kernel@vger.kernel.org Date: Tue, 31 May 2016 16:59:16 +0800 Message-Id: <1464685157-30738-1-git-send-email-bob.liu@oracle.com> X-Mailer: git-send-email 1.7.10.4 X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: xen-devel@lists.xenproject.org, Bob Liu , roger.pau@citrix.com Subject: [Xen-devel] [PATCH 1/2] xen-blkfront: don't call talk_to_blkback when already connected to blkback X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Sometimes blkfont may receive twice blkback_changed() notification after migration, then talk_to_blkback() will be called twice too and confused xen-blkback. Signed-off-by: Bob Liu --- drivers/block/xen-blkfront.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index ca13df8..01aa460 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2485,7 +2485,8 @@ static void blkback_changed(struct xenbus_device *dev, break; case XenbusStateConnected: - if (dev->state != XenbusStateInitialised) { + if ((dev->state != XenbusStateInitialised) && + (dev->state != XenbusStateConnected)) { if (talk_to_blkback(dev, info)) break; }