aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefano Stabellini <sstabellini@kernel.org>2018-02-14 13:28:24 -0500
committerJuergen Gross <jgross@suse.com>2018-02-17 03:41:06 -0500
commitd1a75e0896f5e9f5cb6a979caaea39f1f4b9feb1 (patch)
tree64a06c2c248dfcfff3da8a9b249005cc573b722a /drivers
parent64d6871827b1e2ac8c9daf49f2c883378c7d50cd (diff)
pvcalls-front: wait for other operations to return when release passive sockets
Passive sockets can have ongoing operations on them, specifically, we have two wait_event_interruptable calls in pvcalls_front_accept. Add two wake_up calls in pvcalls_front_release, then wait for the potential waiters to return and release the sock_mapping refcount. Signed-off-by: Stefano Stabellini <stefano@aporeto.com> Acked-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/pvcalls-front.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 11ce470b41a5..aedbee3b2838 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -1018,6 +1018,12 @@ int pvcalls_front_release(struct socket *sock)
1018 1018
1019 pvcalls_front_free_map(bedata, map); 1019 pvcalls_front_free_map(bedata, map);
1020 } else { 1020 } else {
1021 wake_up(&bedata->inflight_req);
1022 wake_up(&map->passive.inflight_accept_req);
1023
1024 while (atomic_read(&map->refcount) > 1)
1025 cpu_relax();
1026
1021 spin_lock(&bedata->socket_lock); 1027 spin_lock(&bedata->socket_lock);
1022 list_del(&map->list); 1028 list_del(&map->list);
1023 spin_unlock(&bedata->socket_lock); 1029 spin_unlock(&bedata->socket_lock);