Bug 54476 - Linux kernel API change: EISDIR -> EEXIST
Linux kernel API change: EISDIR -> EEXIST
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-1-errata
Assigned To: Philipp Hahn
Julia Bremer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-02-22 09:15 CET by Philipp Hahn
Modified: 2022-02-23 16:29 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): API change
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2022-02-22 09:15:29 CET
univention.config_registry.backend contains code to atomically create the base*.conf files: <https://git.knut.univention.de/univention/ucs/-/blob/5.0-1/base/univention-config-registry/python/univention/config_registry/backend.py#L637-641>

>	try:
>		reg_file = os.open(self.file, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o644)>	except EnvironmentError as ex:
>		if ex.errno != errno.EEXIST:

Do to an API change in the Linux Kernel v5.7-rc1~128 <https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.16.10&id=b94e0b32c899914f045ddf05949517d64fd32499> this is now broken:
- Up to Linux 5.6 returned EEXIST even for directories
- Since Linux 5.7 returns EISDIR for directories

This is tested by <https://git.knut.univention.de/univention/ucs/-/blob/5.0-1/base/univention-config-registry/tests/test_backend.py#L81-83>, which now fails if the maggLinux Kernel of the build environment is new enough: Currently Debian-11-Bullseye and backports using Linux 5.10 are already affected.
This both affects building on the host or in pbuilder or in Docker. Our new GitLab runners are affected because their kernel is newer.

This currently blocks all build pipelines.
Comment 1 Philipp Hahn univentionstaff 2022-02-22 09:41:25 CET
[5.0-1] b5962db4d3 fix[ucr]: Linux API change open(O_EXCL): EISDIR→EEXIST
 base/univention-config-registry/debian/changelog                             |  6 ++++++
 base/univention-config-registry/python/univention/config_registry/backend.py |  9 +++++----
 base/univention-config-registry/tests/test_backend.py                        |  5 +++--
 doc/errata/staging/univention-config-registry.yaml                           | 11 +++++++++++
 4 files changed, 25 insertions(+), 6 deletions(-)

[5.0-1] 6b66b7052d Bug #54476: univention-config-registry 15.0.7-18A~5.0.0.202202220928
 base/univention-config-registry/tests/test_backend.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Package: univention-config-registry
Version: 15.0.7-18A~5.0.0.202202220928
Branch: ucs_5.0-0
Scope: errata5.0-1

[5.0-1] fd5813c737 Bug #54476: univention-config-registry 15.0.7-18A~5.0.0.202202220928
 doc/errata/staging/univention-config-registry.yaml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

QA: ucslint <https://git.knut.univention.de/univention/ucs/-/jobs/373623>
QA: build <https://git.knut.univention.de/univention/ucs/-/jobs/373624#L1872>

FYI: No backport to 4.4-8 needed as their this is not tested, but the error is there too.
Comment 2 Julia Bremer univentionstaff 2022-02-22 14:59:18 CET
OK: Unittest on new kernel
OK: Unittest on old kernel
OK: Code review
OK: yaml

Verified