public inbox for [email protected]
 help / color / mirror / Atom feed
From: Michael Tokarev <[email protected]>
To: Ammar Faizi <[email protected]>,
	Stefan Metzmacher <[email protected]>
Cc: Caleb Sander <[email protected]>,
	Samba Technical Mailing List  <[email protected]>,
	io-uring Mailing List <[email protected]>
Subject: Re: samba does not work with liburing 2.3
Date: Tue, 8 Nov 2022 22:18:47 +0300	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

08.11.2022 16:43, Ammar Faizi wrote:
> 
> + Adding Caleb Sander <[email protected]> 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

      reply	other threads:[~2022-11-08 19:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[email protected]>
     [not found] ` <[email protected]>
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 message]

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=82a3df48-69ce-fe1d-1c7b-4deabc323eae@msgid.tls.msk.ru \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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