Skip to content

Commit d1a75e0

Browse files
sstabellinijgross1
authored andcommitted
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 <[email protected]> Acked-by: Juergen Gross <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 64d6871 commit d1a75e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/xen/pvcalls-front.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,12 @@ int pvcalls_front_release(struct socket *sock)
10181018

10191019
pvcalls_front_free_map(bedata, map);
10201020
} 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+
10211027
spin_lock(&bedata->socket_lock);
10221028
list_del(&map->list);
10231029
spin_unlock(&bedata->socket_lock);

0 commit comments

Comments
 (0)