From: Marcel Holtmann <marcel@holtmann.org>
To: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>,
BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] Re: L2CAP non-blocking socket nasty race conditions
Date: Thu, 05 Feb 2004 02:00:18 +0100 [thread overview]
Message-ID: <1075942818.2783.70.camel@pegasus> (raw)
In-Reply-To: <20040204214541.GA20129@bougret.hpl.hp.com>
Hi Jean,
> I could find an informal arrangement if you want my code, like
> "for your eyes only", but it's also not totally trivial to setup.
not needed, because it is very clear where the problem is. But thanks
for the offer.
> Yes, the accept() code is right, what's wrong is obviously the
> "poll" code that should not indicate socket readyness before the
> socket is really ready.
> The more "correct" way would be to change the "poll()" code to
> really test child socket readyness instead of just testing
> sk_ack_backlog. But, the poll code would get very ugly quickly.
> One of the simplest way would be to increase sk_ack_backlog
> only when the socket change to the BT_CONNECTED state (as opposed to
> immediately when we add it to the parent queue). I would need to
> understand where and how exactly is sk_ack_backlog used.
> Another solution if we can't use sk_ack_backlog is to use our
> own counter to count the number of child ready, or a flag, or whatever
> mechanism.
I don't see what sk_ack_backlog have to do with it. Can you explain this
to me?
I haven't tested this yet, but I think the problem is the extra check in
bt_sock_poll() for the accept_q:
if (!skb_queue_empty(&sk->sk_receive_queue) ||
!list_empty(&bt_sk(sk)->accept_q) ||
(sk->sk_shutdown & RCV_SHUTDOWN))
mask |= POLLIN | POLLRDNORM;
Regards
Marcel
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2004-02-05 1:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-04 1:58 L2CAP non-blocking socket nasty race conditions Jean Tourrilhes
2004-02-04 7:17 ` [Bluez-devel] " Marcel Holtmann
2004-02-04 17:58 ` Jean Tourrilhes
2004-02-04 19:58 ` [Bluez-devel] " Marcel Holtmann
2004-02-04 21:45 ` Jean Tourrilhes
2004-02-05 1:00 ` Marcel Holtmann [this message]
2004-02-05 1:11 ` Jean Tourrilhes
2004-02-05 1:30 ` [Bluez-devel] " Marcel Holtmann
2004-02-05 1:40 ` Jean Tourrilhes
2004-02-05 2:21 ` [Bluez-devel] " Marcel Holtmann
2004-02-05 2:26 ` Jean Tourrilhes
2004-02-05 2:36 ` [Bluez-devel] " Marcel Holtmann
2004-02-05 2:42 ` Jean Tourrilhes
2004-02-05 3:30 ` Jean Tourrilhes
2004-02-05 13:49 ` [Bluez-devel] " Marcel Holtmann
2004-02-05 17:19 ` Jean Tourrilhes
2004-02-05 18:17 ` [Bluez-devel] " Marcel Holtmann
2004-02-05 23:13 ` Jean Tourrilhes
2004-02-05 23:37 ` [Bluez-devel] " Marcel Holtmann
2004-02-05 23:43 ` Jean Tourrilhes
2004-02-04 11:23 ` [Bluez-devel] bluez & qos Mauro Tortonesi
2004-02-04 11:36 ` Marcel Holtmann
2004-02-04 17:46 ` [Bluez-devel] " Jean Tourrilhes
2004-02-05 10:46 ` Mauro Tortonesi
2004-02-05 17:22 ` Jean Tourrilhes
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=1075942818.2783.70.camel@pegasus \
--to=marcel@holtmann.org \
--cc=bluez-devel@lists.sourceforge.net \
--cc=jt@hpl.hp.com \
--cc=maxk@qualcomm.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