Re: [Nbd] [PATCH 1/4] nbd: Remove signal usage
- To: Markus Pargmann <mpa@...1897...>
- Cc: nbd-general@lists.sourceforge.net, Christoph Hellwig <hch@...1270...>, Oleg Nesterov <oleg@...696...>, linux-kernel@...25...
- Subject: Re: [Nbd] [PATCH 1/4] nbd: Remove signal usage
- From: Al Viro <viro@...2155...>
- Date: Tue, 10 Nov 2015 04:46:18 +0000
- Message-id: <20151110044617.GC22011@...2155...>
- In-reply-to: <1446133360-30652-2-git-send-email-mpa@...1897...>
- References: <1446133360-30652-1-git-send-email-mpa@...1897...> <1446133360-30652-2-git-send-email-mpa@...1897...>
On Thu, Oct 29, 2015 at 04:42:37PM +0100, Markus Pargmann wrote:
> del_timer_sync(&nbd->timeout_timer);
> +
> +out:
> + spin_unlock_irq(&nbd->sock_lock);
... and in its callback we have this:
> @@ -148,17 +155,15 @@ static void nbd_xmit_timeout(unsigned long arg)
>
> nbd->disconnect = true;
>
> - spin_lock_irqsave(&nbd->tasks_lock, flags);
> + spin_lock_irqsave(&nbd->sock_lock, flags);
* CPU 1 enters sock_shutdown() and grabs ->sock_lock.
* on CPU2 the timer hits and we enter the callback, where we spin on that
spinlock.
* in the meanwhile, CPU1 calls del_timer_sync()
Deadlock...
Reply to: