From: Johan Hedberg <johan.hedberg@gmail.com>
To: Dean Jenkins <Dean_Jenkins@mentor.com>
Cc: linux-bluetooth@vger.kernel.org, marcel@holtmann.org,
Joshua_Frkuska@mentor.com
Subject: Re: [PATCH v2 3/8] Bluetooth: Unwind l2cap_sock_shutdown()
Date: Mon, 13 Jul 2015 14:07:31 +0300 [thread overview]
Message-ID: <20150713110731.GA21598@t440s.lan> (raw)
In-Reply-To: <1435078779-4436-4-git-send-email-Dean_Jenkins@mentor.com>
Hi Dean,
On Tue, Jun 23, 2015, Dean Jenkins wrote:
> --- a/net/bluetooth/l2cap_sock.c
> +++ b/net/bluetooth/l2cap_sock.c
> @@ -1100,6 +1100,13 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
> if (!sk)
> return 0;
>
> + lock_sock(sk);
> +
> + if (sk->sk_shutdown)
> + goto shutdown_already;
> +
> + sk->sk_shutdown = SHUTDOWN_MASK;
> +
> /* prevent sk structure from being freed whilst unlocked */
> sock_hold(sk);
>
> @@ -1114,30 +1121,21 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
> mutex_lock(&conn->chan_lock);
>
> l2cap_chan_lock(chan);
> - lock_sock(sk);
I guess this is at least part of the reason for the lockdep warnings we
started getting after your patches. The order of these locks should
always be l2cap_chan_lock() and then lock_sock(). Any other order
exposes us to potential deadlocks and the kernel lockdep system rightly
warns about it.
Do you think you'll be able to fix this as well as the missing
mutex_lock(&conn->chan_lock) issue this week? Otherwise we'll need to
consider reverting your patches since it's quite clear we can't make any
bluetooth-next pull requests with the current state of the tree.
Johan
next prev parent reply other threads:[~2015-07-13 11:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 16:59 [PATCH v2 0/8] Avoid L2CAP ERTM shutdown hung tasks Dean Jenkins
2015-06-23 16:59 ` [PATCH v2 1/8] Bluetooth: L2CAP ERTM shutdown protect sk and chan Dean Jenkins
2015-06-23 16:59 ` [PATCH v2 2/8] Bluetooth: Make __l2cap_wait_ack more efficient Dean Jenkins
2015-06-23 16:59 ` [PATCH v2 3/8] Bluetooth: Unwind l2cap_sock_shutdown() Dean Jenkins
2015-07-13 11:07 ` Johan Hedberg [this message]
2015-07-13 17:31 ` Dean Jenkins
2015-07-14 10:47 ` Johan Hedberg
2015-07-16 8:08 ` Johan Hedberg
2015-07-16 8:37 ` Dean Jenkins
2015-07-30 11:51 ` Marcel Holtmann
2015-06-23 16:59 ` [PATCH v2 4/8] Bluetooth: l2cap_sock_shutdown() remove mutex_lock calls Dean Jenkins
2015-06-23 16:59 ` [PATCH v2 5/8] Bluetooth: l2cap_sock_shutdown() reduce scope of chan locking Dean Jenkins
2015-07-13 10:26 ` Johan Hedberg
2015-07-13 11:12 ` Johan Hedberg
2015-06-23 16:59 ` [PATCH v2 6/8] Bluetooth: Add BT_DBG to l2cap_sock_shutdown() Dean Jenkins
2015-06-23 16:59 ` [PATCH v2 7/8] Bluetooth: __l2cap_wait_ack() use msecs_to_jiffies() Dean Jenkins
2015-06-23 16:59 ` [PATCH v2 8/8] Bluetooth: __l2cap_wait_ack() add defensive timeout Dean Jenkins
2015-07-09 8:42 ` [PATCH v2 0/8] Avoid L2CAP ERTM shutdown hung tasks Marcel Holtmann
2015-07-09 9:36 ` Johan Hedberg
2015-07-09 9:56 ` Johan Hedberg
2015-07-09 9:58 ` Dean Jenkins
2015-07-09 10:06 ` Marcel Holtmann
2015-07-09 10:14 ` Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150713110731.GA21598@t440s.lan \
--to=johan.hedberg@gmail.com \
--cc=Dean_Jenkins@mentor.com \
--cc=Joshua_Frkuska@mentor.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.