public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Daryl Van Vorst <daryl@wideray.com>
Cc: "'BlueZ Mailing List'" <bluez-devel@lists.sourceforge.net>
Subject: RE: [Bluez-devel] Rfcomm Use Count
Date: Wed, 22 Sep 2004 00:07:24 +0200	[thread overview]
Message-ID: <1095804444.5762.21.camel@pegasus> (raw)
In-Reply-To: <001c01c4a021$b21545c0$1a01010a@baked>

Hi Daryl,

> Looks like the rfcomm part isn't quite there. The accept queue doesn't fill
> up, but the use count still increases. And /proc/bluetooth/rfcomm still
> lists all of the closed sockets.
> 
> I added rfcomm_sock_close() and rfcomm_sock_kill() right after your addition
> to rfcomm_sk_state_change() and it seems to work. The affects of
> rfcomm_sock_alloc() (called by ...connect_ind()) needed to be dealt with. I
> changed it as follows:
> 
> --- mh_sock.c	2004-09-21 14:21:36.000000000 -0700
> +++ sock.c	2004-09-21 14:21:47.000000000 -0700
> @@ -104,8 +104,11 @@
>  			rfcomm_session_getaddr(d->session,
> &bluez_pi(sk)->src, NULL);
>  		sk->state_change(sk);
>  	} else {
> -		if (d->state == BT_CLOSED)
> +		if (d->state == BT_CLOSED) {
>  			bluez_accept_unlink(sk);
> +			rfcomm_sock_close(sk);
> +			rfcomm_sock_kill(sk);
> +		}
>  		parent->data_ready(parent, 0);
>  	}
>  
> I am not sure about the possible negative side effects of this. What do you
> think?

what I think is that we have two different bugs here. We may solved the
first one now, which wasn't a module reference count bug. The second now
increases the module reference count and don't decreases it correctly.
Since the RFCOMM implementation is much more complex, because of its
support for TTY and sockets as end user interfaces, we need to find out
if the socket functions are involved or the core/TTY functions.

At the moment I think calling ...sock_close() and ...sock_kill() in that
function is wrong. However I am not 100% sure.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2004-09-21 22:07 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-17  0:10 [Bluez-devel] Rfcomm Use Count Daryl Van Vorst
2004-09-17  8:58 ` Marcel Holtmann
2004-09-20 17:58   ` Daryl Van Vorst
2004-09-20 18:32     ` Marcel Holtmann
2004-09-20 18:52       ` Daryl Van Vorst
2004-09-20 19:48         ` Marcel Holtmann
2004-09-20 20:52           ` Daryl Van Vorst
2004-09-20 18:37     ` Daryl Van Vorst
2004-09-20 19:50       ` Marcel Holtmann
2004-09-20 20:11         ` Daryl Van Vorst
2004-09-20 20:34           ` Marcel Holtmann
2004-09-20 21:03             ` Daryl Van Vorst
2004-09-20 21:28               ` Marcel Holtmann
2004-09-20 22:38                 ` Daryl Van Vorst
2004-09-20 23:33                   ` Marcel Holtmann
2004-09-21 20:14                     ` Daryl Van Vorst
2004-09-21 20:32                       ` Marcel Holtmann
2004-09-21 20:39                         ` Daryl Van Vorst
2004-09-21 21:26                           ` Daryl Van Vorst
2004-09-21 22:07                             ` Marcel Holtmann [this message]
2004-09-21 22:26                               ` Marcel Holtmann
2004-09-21 22:44                                 ` Daryl Van Vorst
2004-09-22 11:08                                   ` Marcel Holtmann
2004-09-22 13:53                                     ` Marcel Holtmann
2004-09-22 17:57                                       ` Daryl Van Vorst
2004-09-22 18:12                                         ` Marcel Holtmann
2004-09-22 19:05                                           ` Daryl Van Vorst
2004-09-22 19:33                                             ` Marcel Holtmann
2004-09-22 19:52                                               ` Daryl Van Vorst
2004-09-22 19:57                                                 ` Marcel Holtmann
2004-09-22 20:05                                                   ` Daryl Van Vorst
     [not found]                                       ` <1096471423.20392.444.camel@igno>
2004-10-02  9:26                                         ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2004-09-13 19:06 [Bluez-devel] Rfcomm use count Daryl Van Vorst
2004-09-13 20:48 ` Daryl Van Vorst
2004-09-13 23:54   ` Daryl Van Vorst
2004-09-14  9:18     ` Marcel Holtmann
2004-09-14 21:58       ` Daryl Van Vorst
2004-08-31 22:09 Daryl Van Vorst
2004-09-08 22:48 ` Daryl Van Vorst
2004-09-08 23:10   ` Daryl Van Vorst
2004-09-12 14:15 ` Marcel Holtmann

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=1095804444.5762.21.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=daryl@wideray.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox