diff options
author | Stefano Stabellini <sstabellini@kernel.org> | 2018-02-05 14:47:55 -0800 |
---|---|---|
committer | Stefano Stabellini <sstabellini@kernel.org> | 2018-02-05 14:47:55 -0800 |
commit | 83aeec5279e3b1c516ba84f8ba6b22f137e021c4 (patch) | |
tree | 98b649578d9ea3aa2ac481f3d8581fa7bd75ca28 | |
parent | 90bb13bc47a6713810fecb181f511873f4bca32c (diff) | |
download | xen-pvcalls-4.16.tar.gz |
pvcalls-front: wait for other operations to return when release passive socketspvcalls-4.16
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>
-rw-r--r-- | drivers/xen/pvcalls-front.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index 164d3ad17e179..d32cac55e07a6 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -1017,6 +1017,12 @@ int pvcalls_front_release(struct socket *sock) pvcalls_front_free_map(bedata, map); } else { + wake_up(&bedata->inflight_req); + wake_up(&map->passive.inflight_accept_req); + + while (atomic_read(&map->refcount) > 1) + cpu_relax(); + spin_lock(&bedata->socket_lock); list_del(&map->list); spin_unlock(&bedata->socket_lock); |