All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFCv0] Bluetooth: Remove extra chan_put
@ 2012-02-09 13:06 Emeltchenko Andrei
  2012-02-10 18:33 ` Ulisses Furquim
  0 siblings, 1 reply; 4+ messages in thread
From: Emeltchenko Andrei @ 2012-02-09 13:06 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Removing l2cap_chan_put since in this function we use l2cap_chan_close
and ops->close which use l2cap_chan_put.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
I am not sure that I have checked all possible cases, so I am sending
this as RFC.

 net/bluetooth/l2cap_core.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index f1a6b3c..7db6d7f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -274,7 +274,6 @@ static void l2cap_chan_timeout(struct work_struct *work)
 	release_sock(sk);
 
 	chan->ops->close(chan->data);
-	l2cap_chan_put(chan);
 }
 
 struct l2cap_chan *l2cap_chan_create(struct sock *sk)
-- 
1.7.8.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFCv0] Bluetooth: Remove extra chan_put
  2012-02-09 13:06 [RFCv0] Bluetooth: Remove extra chan_put Emeltchenko Andrei
@ 2012-02-10 18:33 ` Ulisses Furquim
  2012-02-13 14:36   ` Emeltchenko Andrei
  0 siblings, 1 reply; 4+ messages in thread
From: Ulisses Furquim @ 2012-02-10 18:33 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

On Thu, Feb 9, 2012 at 11:06 AM, Emeltchenko Andrei
<Andrei.Emeltchenko.news@gmail.com> wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> Removing l2cap_chan_put since in this function we use l2cap_chan_close
> and ops->close which use l2cap_chan_put.
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
> I am not sure that I have checked all possible cases, so I am sending
> this as RFC.
>
>  net/bluetooth/l2cap_core.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index f1a6b3c..7db6d7f 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -274,7 +274,6 @@ static void l2cap_chan_timeout(struct work_struct *work)
>        release_sock(sk);
>
>        chan->ops->close(chan->data);
> -       l2cap_chan_put(chan);
>  }
>
>  struct l2cap_chan *l2cap_chan_create(struct sock *sk)
> --
> 1.7.8.3

While I think you maybe right, please add BT_DBG() to l2cap_chan_hold
and l2cap_chan_put and check that. If so, put that information also in
your patch, please.

Regards,

-- 
Ulisses Furquim
ProFUSION embedded systems
http://profusion.mobi
Mobile: +55 19 9250 0942
Skype: ulissesffs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFCv0] Bluetooth: Remove extra chan_put
  2012-02-10 18:33 ` Ulisses Furquim
@ 2012-02-13 14:36   ` Emeltchenko Andrei
  2012-02-14  1:08     ` Ulisses Furquim
  0 siblings, 1 reply; 4+ messages in thread
From: Emeltchenko Andrei @ 2012-02-13 14:36 UTC (permalink / raw)
  To: Ulisses Furquim; +Cc: linux-bluetooth

Hi Ulisses,

On Fri, Feb 10, 2012 at 04:33:51PM -0200, Ulisses Furquim wrote:
> Hi Andrei,
> 
> On Thu, Feb 9, 2012 at 11:06 AM, Emeltchenko Andrei
> <Andrei.Emeltchenko.news@gmail.com> wrote:
> > From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> >
> > Removing l2cap_chan_put since in this function we use l2cap_chan_close
> > and ops->close which use l2cap_chan_put.
> >
> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > ---
> > I am not sure that I have checked all possible cases, so I am sending
> > this as RFC.
> >
> >  net/bluetooth/l2cap_core.c |    1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> > index f1a6b3c..7db6d7f 100644
> > --- a/net/bluetooth/l2cap_core.c
> > +++ b/net/bluetooth/l2cap_core.c
> > @@ -274,7 +274,6 @@ static void l2cap_chan_timeout(struct work_struct *work)
> >        release_sock(sk);
> >
> >        chan->ops->close(chan->data);
> > -       l2cap_chan_put(chan);
> >  }
> >
> >  struct l2cap_chan *l2cap_chan_create(struct sock *sk)
> > --
> > 1.7.8.3
> 
> While I think you maybe right, please add BT_DBG() to l2cap_chan_hold
> and l2cap_chan_put and check that. If so, put that information also in
> your patch, please.

I try to do it, but this case is hard to reproduce (maybe I need to reduce
timeout for the check).

Best regards 
Andrei Emeltchenko 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFCv0] Bluetooth: Remove extra chan_put
  2012-02-13 14:36   ` Emeltchenko Andrei
@ 2012-02-14  1:08     ` Ulisses Furquim
  0 siblings, 0 replies; 4+ messages in thread
From: Ulisses Furquim @ 2012-02-14  1:08 UTC (permalink / raw)
  To: Emeltchenko Andrei, Ulisses Furquim, linux-bluetooth

Hi Andrei,

On Mon, Feb 13, 2012 at 11:36 AM, Emeltchenko Andrei
<Andrei.Emeltchenko.news@gmail.com> wrote:
> Hi Ulisses,
>
> On Fri, Feb 10, 2012 at 04:33:51PM -0200, Ulisses Furquim wrote:
>> Hi Andrei,
>>
>> On Thu, Feb 9, 2012 at 11:06 AM, Emeltchenko Andrei
>> <Andrei.Emeltchenko.news@gmail.com> wrote:
>> > From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>> >
>> > Removing l2cap_chan_put since in this function we use l2cap_chan_close
>> > and ops->close which use l2cap_chan_put.
>> >
>> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>> > ---
>> > I am not sure that I have checked all possible cases, so I am sending
>> > this as RFC.
>> >
>> >  net/bluetooth/l2cap_core.c |    1 -
>> >  1 files changed, 0 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
>> > index f1a6b3c..7db6d7f 100644
>> > --- a/net/bluetooth/l2cap_core.c
>> > +++ b/net/bluetooth/l2cap_core.c
>> > @@ -274,7 +274,6 @@ static void l2cap_chan_timeout(struct work_struct *work)
>> >        release_sock(sk);
>> >
>> >        chan->ops->close(chan->data);
>> > -       l2cap_chan_put(chan);
>> >  }
>> >
>> >  struct l2cap_chan *l2cap_chan_create(struct sock *sk)
>> > --
>> > 1.7.8.3
>>
>> While I think you maybe right, please add BT_DBG() to l2cap_chan_hold
>> and l2cap_chan_put and check that. If so, put that information also in
>> your patch, please.
>
> I try to do it, but this case is hard to reproduce (maybe I need to reduce
> timeout for the check).

Well, if it's hard to reproduce than we really need to be sure we're
fixing the problem by removing this _chan_put() call. With the debug
messages printed in _hold() and _put() we can more easily check if we
have an imbalance.

Regards,

-- 
Ulisses Furquim
ProFUSION embedded systems
http://profusion.mobi
Mobile: +55 19 9250 0942
Skype: ulissesffs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-14  1:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-09 13:06 [RFCv0] Bluetooth: Remove extra chan_put Emeltchenko Andrei
2012-02-10 18:33 ` Ulisses Furquim
2012-02-13 14:36   ` Emeltchenko Andrei
2012-02-14  1:08     ` Ulisses Furquim

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.