Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967020AbcLVW62 (ORCPT ); Thu, 22 Dec 2016 17:58:28 -0500 Received: from p3plsmtps2ded04.prod.phx3.secureserver.net ([208.109.80.198]:42542 "EHLO p3plsmtps2ded04.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966119AbcLVW5y (ORCPT ); Thu, 22 Dec 2016 17:57:54 -0500 x-originating-ip: 72.167.245.219 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com Cc: "K. Y. Srinivasan" , Subject: [PATCH 4/4] Drivers: hv: util: Backup: Fix a rescind processing issue Date: Thu, 22 Dec 2016 16:54:03 -0800 Message-Id: <1482454443-10306-4-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1482454443-10306-1-git-send-email-kys@exchange.microsoft.com> References: <1482454418-10265-1-git-send-email-kys@exchange.microsoft.com> <1482454443-10306-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfJu28mz7lTsxi/7ety99eeelwnjCnKGG5W3v7pHm5/28IFkEkZP+QQpsW/t2OPREMl4Ju3AqtBCWnFSvL8Fqr1/6B7sHCz9s6ZJKQT6n/iZBHC/TFUcf ImurtFT0cNLtMmD/Rh5dEIJ9HPEvQbgGscwlZs8RU/FAzaf7F1N6IfdTEWtXSFIiBY9180QlQKOWdOH04oQJAH/lruA+lKQGScylTCsVnivosXv5yt1/JBxU X2g5JFMPQTIGwE3Y9KxMs4vrrRBt8SfPPOMsl22BgL9Lkrs24A/vqgVTuFLF84OjGvViuXp1YfsqMAyDIGXGuV5VypCZitWfUhyzWvEsnzyafoXnfW6YkDFd Bw4GX1ro1+HklTvkDW01sbcVbJUIufmiiFDCdRFveN+YcrOx2pPI97vlX7DntHzSJvzpYl2BOPHFTOQpQn59WPmoTaRVgC+13MvtpEGkU7A4We1ArFvknbIX DSg/UJ18eEmQzJ8RWDIgwZLmZJOh0UTfECDdTA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1624 Lines: 47 From: K. Y. Srinivasan VSS may use a char device to support the communication between the user level daemon and the driver. When the VSS channel is rescinded we need to make sure that the char device is fully cleaned up before we can process a new VSS offer from the host. Implement this logic. Signed-off-by: K. Y. Srinivasan Cc: --- drivers/hv/hv_snapshot.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c index eee238c..4e543db 100644 --- a/drivers/hv/hv_snapshot.c +++ b/drivers/hv/hv_snapshot.c @@ -69,6 +69,7 @@ static const char vss_devname[] = "vmbus/hv_vss"; static __u8 *recv_buffer; static struct hvutil_transport *hvt; +static struct completion release_event; static void vss_timeout_func(struct work_struct *dummy); static void vss_handle_request(struct work_struct *dummy); @@ -345,11 +346,13 @@ static void vss_on_reset(void) if (cancel_delayed_work_sync(&vss_timeout_work)) vss_respond_to_host(HV_E_FAIL); vss_transaction.state = HVUTIL_DEVICE_INIT; + complete(&release_event); } int hv_vss_init(struct hv_util_service *srv) { + init_completion(&release_event); if (vmbus_proto_version < VERSION_WIN8_1) { pr_warn("Integration service 'Backup (volume snapshot)'" " not supported on this host version.\n"); @@ -382,4 +385,5 @@ void hv_vss_deinit(void) cancel_delayed_work_sync(&vss_timeout_work); cancel_work_sync(&vss_handle_request_work); hvutil_transport_destroy(hvt); + wait_for_completion(&release_event); } -- 1.7.4.1