From: Gustavo Padovan <padovan@profusion.mobi>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/2] serial: Add support to Disconnect fd passing connections
Date: Thu, 8 Sep 2011 15:35:30 -0300 [thread overview]
Message-ID: <20110908183530.GB2695@joana> (raw)
In-Reply-To: <CABBYNZJ=yQP_qB=0_dVjGNe5HtAqW5UEw1+Wez07f08EMQ2tYQ@mail.gmail.com>
* Luiz Augusto von Dentz <luiz.dentz@gmail.com> [2011-09-07 18:05:08 +0300]:
> Hi Marcel,
>
> On Wed, Sep 7, 2011 at 3:46 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> > Hi Luiz,
> >
> >> > yes, you do have to keep track of the client. You wanna do a proper
> >> > shutdown if the client exits unexpectedly. Or forgets to call shutdown.
> >>
> >> I guess the kernel would auto release the socket if the process exit
> >> and nobody else has a reference to it, so if we close our fd after it
> >> has been transferred the only one with reference is the client, iirc
> >> this was a problem to tty because we have to release the devnode to
> >> disconnect which involves ioctl but afaik that is not the case for
> >> sockets and the client can basically call close and be done with it,
> >> right?
> >
> > does dbus-daemon holds the reference for the time of D-Bus message to be
> > in flight between bluetoothd and the client? If not, then we have a race
> > condition here, because we dropped the reference before it ended up on
> > the other side.
>
> Good question, iirc dbus-daemon does use dup but we better confirm
> with Lennart how this is supposed to work. Anyway if it doesn't then I
> guess it should be fixed in dbus-daemon to do it, otherwise as you
> said it will be racy to transfer fd specially when fd is send in a
> reply.
It does use dup, I just checked on the source code.
Gustavo
next prev parent reply other threads:[~2011-09-08 18:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 17:19 [PATCH 1/2] serial: add Serial.ConnectFD() Gustavo F. Padovan
2011-08-22 17:19 ` [PATCH 2/2] serial: Add support to Disconnect fd passing connections Gustavo F. Padovan
2011-08-23 16:18 ` Marcel Holtmann
2011-08-23 16:28 ` Gustavo Padovan
2011-08-23 16:30 ` Marcel Holtmann
2011-08-23 16:45 ` Gustavo Padovan
2011-08-23 18:39 ` Luiz Augusto von Dentz
2011-08-23 18:52 ` Gustavo Padovan
2011-08-23 19:51 ` Marcel Holtmann
2011-08-24 10:43 ` Luiz Augusto von Dentz
2011-08-25 14:55 ` Gustavo Padovan
2011-08-26 7:22 ` Luiz Augusto von Dentz
2011-08-26 18:16 ` Gustavo Padovan
2011-09-06 5:16 ` Gustavo Padovan
2011-09-07 7:50 ` Luiz Augusto von Dentz
2011-09-07 11:56 ` Marcel Holtmann
2011-09-07 12:09 ` Luiz Augusto von Dentz
2011-09-07 12:46 ` Marcel Holtmann
2011-09-07 15:05 ` Luiz Augusto von Dentz
2011-09-08 18:35 ` Gustavo Padovan [this message]
2011-09-07 11:54 ` 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=20110908183530.GB2695@joana \
--to=padovan@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox