OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [RFC v4 6/6] AF_VSOCK: Silence lockep error


On Thu, Mar 31, 2016 at 01:41:38PM +0200, Claudio Imbrenda wrote:
> This patch uses nested locking to silence a lockdep error.
> I'm not sure if it won't actually allow for deadlocks.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
> ---
>  net/vmw_vsock/af_vsock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> index 9783a38..0390fbe 100644
> --- a/net/vmw_vsock/af_vsock.c
> +++ b/net/vmw_vsock/af_vsock.c
> @@ -1289,7 +1289,7 @@ static int vsock_accept(struct socket *sock, struct socket *newsock, int flags)
>  	if (connected) {
>  		listener->sk_ack_backlog--;
>  
> -		lock_sock(connected);
> +		lock_sock_nested(connected, SINGLE_DEPTH_NESTING);
>  		vconnected = vsock_sk(connected);
>  
>  		/* If the listener socket has received an error, then we should

This looks fine to me.  The lock ordering is always listener, followed
by child socket.

Stefan

Attachment: signature.asc
Description: PGP signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]