2012-05-07 11:49:43

by Johannes Berg

[permalink] [raw]
Subject: batostr() function

Really? 2 static buffers that are used alternately based on a static
variable? How can that possibly be thread-safe? That may work in very
restricted scenarios, but ...

johannes



2012-05-08 18:26:53

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: batostr() function

On Tue, May 8, 2012 at 10:48 AM, Johannes Berg
<[email protected]> wrote:
> On Tue, 2012-05-08 at 10:18 -0700, Joe Perches wrote:
>> On Tue, 2012-05-08 at 17:30 +0300, Andrei Emeltchenko wrote:
>> > On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
>> > > On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
>> > > > Hi Johannes
>> > > >
>> > > > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <[email protected]> wrote:
>> > > > > Really? 2 static buffers that are used alternately based on a static
>> > > > > variable? How can that possibly be thread-safe? That may work in very
>> > > > > restricted scenarios, but ...
>> > > >
>> > > > Looking at "git blame" it seems the whole function is still from
>> > > > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
>> > > > it, thanks.
>> > >
>> > > I was thinking you could use %pM, but it seems BT addresses are stored
>> > > the wrong way around for some reason ...
>> >
>> > This looks like better idea then allocating buffers, we can use swap to
>> > take care about "wrong order".
>>
>> https://lkml.org/lkml/2010/12/3/358
>
> Pretty much what I had in mind, thanks. Luis, you'll notice that this
> will be a pain to backport in compat. :-)

Mumble grumble. Oh well! :) I'm starting to enjoy the curve balls.

Luis

2012-05-08 17:48:33

by Johannes Berg

[permalink] [raw]
Subject: Re: batostr() function

On Tue, 2012-05-08 at 10:18 -0700, Joe Perches wrote:
> On Tue, 2012-05-08 at 17:30 +0300, Andrei Emeltchenko wrote:
> > On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
> > > On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> > > > Hi Johannes
> > > >
> > > > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <[email protected]> wrote:
> > > > > Really? 2 static buffers that are used alternately based on a static
> > > > > variable? How can that possibly be thread-safe? That may work in very
> > > > > restricted scenarios, but ...
> > > >
> > > > Looking at "git blame" it seems the whole function is still from
> > > > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> > > > it, thanks.
> > >
> > > I was thinking you could use %pM, but it seems BT addresses are stored
> > > the wrong way around for some reason ...
> >
> > This looks like better idea then allocating buffers, we can use swap to
> > take care about "wrong order".
>
> https://lkml.org/lkml/2010/12/3/358

Pretty much what I had in mind, thanks. Luis, you'll notice that this
will be a pain to backport in compat. :-)

johannes


2012-05-08 17:18:52

by Joe Perches

[permalink] [raw]
Subject: Re: batostr() function

On Tue, 2012-05-08 at 17:30 +0300, Andrei Emeltchenko wrote:
> On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
> > On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> > > Hi Johannes
> > >
> > > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <[email protected]> wrote:
> > > > Really? 2 static buffers that are used alternately based on a static
> > > > variable? How can that possibly be thread-safe? That may work in very
> > > > restricted scenarios, but ...
> > >
> > > Looking at "git blame" it seems the whole function is still from
> > > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> > > it, thanks.
> >
> > I was thinking you could use %pM, but it seems BT addresses are stored
> > the wrong way around for some reason ...
>
> This looks like better idea then allocating buffers, we can use swap to
> take care about "wrong order".

https://lkml.org/lkml/2010/12/3/358



2012-05-08 14:30:12

by Andrei Emeltchenko

[permalink] [raw]
Subject: Re: batostr() function

On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
> On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> > Hi Johannes
> >
> > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <[email protected]> wrote:
> > > Really? 2 static buffers that are used alternately based on a static
> > > variable? How can that possibly be thread-safe? That may work in very
> > > restricted scenarios, but ...
> >
> > Looking at "git blame" it seems the whole function is still from
> > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> > it, thanks.
>
> I was thinking you could use %pM, but it seems BT addresses are stored
> the wrong way around for some reason ...

This looks like better idea then allocating buffers, we can use swap to
take care about "wrong order".

Best regards
Andrei Emeltchenko


2012-05-08 14:25:08

by Johannes Berg

[permalink] [raw]
Subject: Re: batostr() function

On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> Hi Johannes
>
> On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <[email protected]> wrote:
> > Really? 2 static buffers that are used alternately based on a static
> > variable? How can that possibly be thread-safe? That may work in very
> > restricted scenarios, but ...
>
> Looking at "git blame" it seems the whole function is still from
> linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> it, thanks.

I was thinking you could use %pM, but it seems BT addresses are stored
the wrong way around for some reason ...

johannes


2012-05-08 14:20:37

by Ulisses Furquim

[permalink] [raw]
Subject: Re: batostr() function

Hi David,

On Tue, May 8, 2012 at 10:30 AM, David Herrmann
<[email protected]> wrote:
>
> Hi Johannes
>
> On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <[email protected]>
> wrote:
> > Really? 2 static buffers that are used alternately based on a static
> > variable? How can that possibly be thread-safe? That may work in very
> > restricted scenarios, but ...
>
> Looking at "git blame" it seems the whole function is still from
> linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> it, thanks.

Thanks for fixing it. I'm sure we haven't noticed but it's still weird
to have it this way. :-/

Regards,

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

2012-05-08 13:30:39

by David Herrmann

[permalink] [raw]
Subject: Re: batostr() function

Hi Johannes

On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <[email protected]> wrote:
> Really? 2 static buffers that are used alternately based on a static
> variable? How can that possibly be thread-safe? That may work in very
> restricted scenarios, but ...

Looking at "git blame" it seems the whole function is still from
linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
it, thanks.

> johannes

Regards
David