Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1500594
| Path | csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Michael Gissing <mg@faulpeltz.net> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] Tools: hv: recover after hv_vss_daemon freeze times out |
| Date | Thu, 13 Oct 2016 23:50:02 +0200 |
| Message-ID | <srW30-AS-9@gated-at.bofh.it> (permalink) |
| X-Greylist | delayed 826 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Oct 2016 17:40:51 EDT |
| X-Sourceip | 84.115.59.110 |
| Dkim-Signature | v=1; a=rsa-sha256; d=faulpeltz.net; s=main; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=hemCulqlGZeL2IyaddqQAmTC27E66u4JI8nKD5z1trI=; b=OGLiUSFQRW3/llBQ8vfAnpeNQi6vE8Ujk8N0P55P66HdBCp3/JzNPIH5Sgzurz2h1KWuScd24ocZlu/XdLHH4H2neTQh0AB2RxJJQg/YJn/Gfbe4+z3h+Lwk7u+ERFRocej9lOiEYxlv6rysbLhdvYnQf086c1IKkvVgxojgD6tlVBmmhS5GCzaP4cEFVyNoBfDzI6m9yGjzBLb6KVmjrU0KLFY8YIYkq+9dwqEk/8+F5IEnyLmBEwmjBJ Mx5de4+er5E1utss2bY8YxRSrHtx/feJSPkm5OUIll2ZEB65tTwheZIkA0NK7Elqe978w168yf5XsrdENeSC/UakH9Nw== |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 51 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | kys@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, gregkh@linuxfoundation.org |
| X-Original-Date | Thu, 13 Oct 2016 23:26:59 +0200 |
| X-Original-Message-ID | <7a8b552a-d1e0-89e2-5f49-7b4fd2011c70@faulpeltz.net> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1500594 |
Show key headers only | View raw
If a FIFREEZE operation run by the hv_vss_daemon takes longer than the
VSS_USERSPACE_TIMEOUT set in the hv_snapshot module, instead of exiting
after a write failure, try to recover by reopening the hv_vss device and
performing the initial handshake again. Exiting causes all subsequent VSS
operations sent by the Hyper-V host to fail until the daemon is restarted.
Signed-off-by: Michael Gissing <mg@faulpeltz.net>
---
tools/hv/hv_vss_daemon.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 5d51d6f..0ecbdab 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -176,6 +176,7 @@ int main(int argc, char *argv[])
openlog("Hyper-V VSS", 0, LOG_USER);
syslog(LOG_INFO, "VSS starting; pid is:%d", getpid());
+recover:
vss_fd = open("/dev/vmbus/hv_vss", O_RDWR);
if (vss_fd < 0) {
syslog(LOG_ERR, "open /dev/vmbus/hv_vss failed; error: %d %s",
@@ -196,6 +197,7 @@ int main(int argc, char *argv[])
}
pfd.fd = vss_fd;
+ in_handshake = 1;
while (1) {
pfd.events = POLLIN;
@@ -258,7 +260,14 @@ int main(int argc, char *argv[])
if (len != sizeof(struct hv_vss_msg)) {
syslog(LOG_ERR, "write failed; error: %d %s", errno,
strerror(errno));
- exit(EXIT_FAILURE);
+ /*
+ * try to recover from possible timeout by THAWing
+ * and restarting the message loop
+ */
+ vss_operate(VSS_OP_THAW);
+ close(vss_fd);
+ syslog(LOG_INFO, "trying to recover VSS connection");
+ goto recover;
}
}
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] Tools: hv: recover after hv_vss_daemon freeze times out Michael Gissing <mg@faulpeltz.net> - 2016-10-13 23:50 +0200
csiph-web