All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: samba does not work with liburing 2.3
       [not found] ` <df789124-d596-cec3-1ca0-cdebf7b823da@msgid.tls.msk.ru>
@ 2022-11-08 13:26   ` Stefan Metzmacher
  2022-11-08 13:42     ` Michael Tokarev
  2022-11-08 13:43     ` Ammar Faizi
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Metzmacher @ 2022-11-08 13:26 UTC (permalink / raw)
  To: Michael Tokarev, samba-technical, io-uring

Am 08.11.22 um 13:56 schrieb Michael Tokarev via samba-technical:
> 08.11.2022 13:25, Michael Tokarev via samba-technical wrote:
>> FWIW, samba built against the relatively new liburing-2.3 does not
>> work right, io_uring-enabled samba just times out in various i/o
>> operations (eg from smbclient) when liburing used at compile time
>> was 2.3. It works fine with liburing 2.2.
> 
> This turned out to be debian packaging issue, but it might affect
> others too. liburing 2.3 breaks ABI by changing layout of the main
> struct io_uring object in a significant way.
> 
> http://bugs.debian.org/1023654

I don't see where this changes the struct size:

-       unsigned pad[4];
+       unsigned ring_mask;
+       unsigned ring_entries;
+
+       unsigned pad[2];

But I see a problem when you compile against 2.3 and run against 2.2
as the new values are not filled.

The problem is the mixture of inline and non-inline functions...

The packaging should make sure it requires the version is build against...

metze



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

* Re: samba does not work with liburing 2.3
  2022-11-08 13:26   ` samba does not work with liburing 2.3 Stefan Metzmacher
@ 2022-11-08 13:42     ` Michael Tokarev
  2022-11-08 13:43     ` Ammar Faizi
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Tokarev @ 2022-11-08 13:42 UTC (permalink / raw)
  To: Stefan Metzmacher, samba-technical, io-uring

08.11.2022 16:26, Stefan Metzmacher wrote:

>> http://bugs.debian.org/1023654
> 
> I don't see where this changes the struct size:

Yeah, I noticed that too after filing that bugreport,
indeed, the problem not in the size of the structures,
but in the changed way - old inline functions used the
deprecated ring_kmask & ring_kentries, while the new
ones uses new ring_mask & ring_entries.

> -       unsigned pad[4];
> +       unsigned ring_mask;
> +       unsigned ring_entries;
> +
> +       unsigned pad[2];
> 
> But I see a problem when you compile against 2.3 and run against 2.2
> as the new values are not filled.
> 
> The problem is the mixture of inline and non-inline functions...

Yeah.

> The packaging should make sure it requires the version is build against...

It is either Depends: liburing2 > $version, or, if the ABI is broken like
this, it is Depends: liburing3 > $newversion (with the soname bump).

At any rate, this is not exactly samba problem, but it affects samba.

Thanks,

/mjt


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

* Re: samba does not work with liburing 2.3
  2022-11-08 13:26   ` samba does not work with liburing 2.3 Stefan Metzmacher
  2022-11-08 13:42     ` Michael Tokarev
@ 2022-11-08 13:43     ` Ammar Faizi
  2022-11-08 19:18       ` Michael Tokarev
  1 sibling, 1 reply; 4+ messages in thread
From: Ammar Faizi @ 2022-11-08 13:43 UTC (permalink / raw)
  To: Stefan Metzmacher
  Cc: Caleb Sander, Michael Tokarev, Samba Technical Mailing List,
	io-uring Mailing List


+ Adding Caleb Sander <csander@purestorage.com> to the CC list.

On 11/8/22 8:26 PM, Stefan Metzmacher wrote:
> Am 08.11.22 um 13:56 schrieb Michael Tokarev via samba-technical:
>> 08.11.2022 13:25, Michael Tokarev via samba-technical wrote:
>>> FWIW, samba built against the relatively new liburing-2.3 does not
>>> work right, io_uring-enabled samba just times out in various i/o
>>> operations (eg from smbclient) when liburing used at compile time
>>> was 2.3. It works fine with liburing 2.2.
>>
>> This turned out to be debian packaging issue, but it might affect
>> others too. liburing 2.3 breaks ABI by changing layout of the main
>> struct io_uring object in a significant way.
>>
>> http://bugs.debian.org/1023654
> 
> I don't see where this changes the struct size:
> 
> -       unsigned pad[4];
> +       unsigned ring_mask;
> +       unsigned ring_entries;
> +
> +       unsigned pad[2];
> 
> But I see a problem when you compile against 2.3 and run against 2.2
> as the new values are not filled.
> 
> The problem is the mixture of inline and non-inline functions...
> 
> The packaging should make sure it requires the version is build against...

-- 
Ammar Faizi


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

* Re: samba does not work with liburing 2.3
  2022-11-08 13:43     ` Ammar Faizi
@ 2022-11-08 19:18       ` Michael Tokarev
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Tokarev @ 2022-11-08 19:18 UTC (permalink / raw)
  To: Ammar Faizi, Stefan Metzmacher
  Cc: Caleb Sander, Samba Technical Mailing List, io-uring Mailing List

08.11.2022 16:43, Ammar Faizi wrote:
> 
> + Adding Caleb Sander <csander@purestorage.com> to the CC list.
> 
> On 11/8/22 8:26 PM, Stefan Metzmacher wrote:
>> Am 08.11.22 um 13:56 schrieb Michael Tokarev via samba-technical:
>>> 08.11.2022 13:25, Michael Tokarev via samba-technical wrote:
>>>> FWIW, samba built against the relatively new liburing-2.3 does not
>>>> work right, io_uring-enabled samba just times out in various i/o
>>>> operations (eg from smbclient) when liburing used at compile time
>>>> was 2.3. It works fine with liburing 2.2.
>>>
>>> This turned out to be debian packaging issue, but it might affect
>>> others too. liburing 2.3 breaks ABI by changing layout of the main
>>> struct io_uring object in a significant way.
>>>
>>> http://bugs.debian.org/1023654
>>
>> I don't see where this changes the struct size:
>>
>> -       unsigned pad[4];
>> +       unsigned ring_mask;
>> +       unsigned ring_entries;
>> +
>> +       unsigned pad[2];
>>
>> But I see a problem when you compile against 2.3 and run against 2.2
>> as the new values are not filled.
>>
>> The problem is the mixture of inline and non-inline functions...
>>
>> The packaging should make sure it requires the version is build against...

As has been pointed out before, this is an issue with debian packaging of
liburing.

2.3 actually appears to be backwards-compatible with previous 2.2, in other
words, programs compiled with 2.2 will continue to work after liburing is
upgraded to 2.3  - at least it *seems* to be the case, which is might be not
what I initially wrote.

The problem happens when you compile a program against liburing 2.3, and
try to run it against the previous liburing-2.2, in other words, going
backwards at runtime.

In order to ensure we have "sufficiently new" library at runtime, there
are package dependencies, - all package managers have them in one way
or another.  Usually it is done by having a table with symbol names
and library versions where/when each symbol appeared, so if a program
uses symbol foo which first appeared in version 1.2 of library lib,
this program is marked as Depends: lib >= 1.2.

But in this case, the symbols are all the same (not counting really new
symbols which actually appeared in 2.3 for the first time).  Yet, the
interface changed somehow for the *newly* compiled programs. In other
words, once a program is compiled against liburing 2.3, it will need
a >=2.3 version of liburing, even if the same symbol it uses first
appeared in earlier version.

This is not something which happens often.  To remedy (assuming the
new lib is really binary compatible with programs compiled with the
old version), Debian needs to change the symbol-version table to list
2.3 version for all symbols, not just for the newly-appeared symbols, -
this way, even if the symbols itself isn't really new, but the newly
compiled program require a more recent version of the interface and
wont work with older symbols of the same name.

This is because of the inline wrappers which gets compiled into the
program, who expects the new struct layout, while the old lib only
provides old layout.

While the new lib works with either layout, so will - hopefully -
work with the now-deprecated structure members too, the same way
it was worked before.

The situation here is rather unusual, and I guess it's rare enough
so that all involved parties were prepared for it. It's easy to
solve at the downstream packaging step, but this has to be done.

It has nothing to do with samba, but with proper packaging of
liburing which - in this case - needs a bit of extra care.

Thanks,

/mjt

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

end of thread, other threads:[~2022-11-08 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5a3d3b11-0858-e85f-e381-943263a92202@msgid.tls.msk.ru>
     [not found] ` <df789124-d596-cec3-1ca0-cdebf7b823da@msgid.tls.msk.ru>
2022-11-08 13:26   ` samba does not work with liburing 2.3 Stefan Metzmacher
2022-11-08 13:42     ` Michael Tokarev
2022-11-08 13:43     ` Ammar Faizi
2022-11-08 19:18       ` Michael Tokarev

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.