lkml.org 
[lkml]   [2017]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 13/18] xen/pvcalls: implement release command
From
Date

> +
> +static int pvcalls_back_release_passive(struct xenbus_device *dev,
> + struct pvcalls_fedata *fedata,
> + struct sockpass_mapping *mappass)
> +{
> + if (mappass->sock->sk != NULL) {
> + write_lock_bh(&mappass->sock->sk->sk_callback_lock);
> + mappass->sock->sk->sk_user_data = NULL;
> + mappass->sock->sk->sk_data_ready = mappass->saved_data_ready;
> + write_unlock_bh(&mappass->sock->sk->sk_callback_lock);
> + }
> + down(&fedata->socket_lock);
> + radix_tree_delete(&fedata->socketpass_mappings, mappass->id);
> + sock_release(mappass->sock);
> + flush_workqueue(mappass->wq);
> + destroy_workqueue(mappass->wq);
> + kfree(mappass);
> + up(&fedata->socket_lock);

Can you raise the semaphore earlier, once the mapping is deleted from
the tree?

Also, why are you not locking the tree in pvcalls_back_accept()?

-boris

\
 
 \ /
  Last update: 2017-06-20 19:14    [W:0.630 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site