Skip to content

Commit

Permalink
pvcalls-front: wait for other operations to return when release passi…
Browse files Browse the repository at this point in the history
…ve 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 <[email protected]>
Acked-by: Juergen Gross <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
  • Loading branch information
sstabellini authored and jgross1 committed Feb 17, 2018
1 parent 64d6871 commit d1a75e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/xen/pvcalls-front.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,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);
Expand Down

0 comments on commit d1a75e0

Please sign in to comment.