sync_file_range fails in nspawn containers on arm, ppc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Dan Streetman | ||
Disco |
Fix Released
|
Medium
|
Dan Streetman |
Bug Description
[impact]
calling the glibc function sync_file_range() on a armhf nspawn container fails.
[test case]
see sample C program from original description below. compile and run that inside a nspawn container on armhf and it will fail.
nspawn instructions:
sudo apt install debootstrap systemd-container
sudo -i
debootstrap --arch=armhf bionic ~/bionic-tree/
systemd-nspawn -D ~/bionic-tree/
[regression potential]
this only adjusts nspawn to allow the sync_file_range2 syscall which is used on armhf, so the regression potential is very low. any possible regressions would likely be when calling sync_file_range().
[other info]
original description:
---
ARM has two sync_file_range syscalls, sync_file_range and sync_file_range2. The former is apparently not used, and glibc calls the latter whenever a userspace program calls sync_file_range. I'm guessing systemd-nspawn doesn't know this, because the follow code consistently fails in an nspawn container on ARM:
#define _GNU_SOURCE
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
void main()
{
int f = open("/
int r=sync_
if (r)
close(f);
}
This seems to be causing problems specifically for borg(backup) and postgres:
https:/
https:/
The solution should be to cherrypick https:/
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: systemd-container 237-3ubuntu10.24
Uname: Linux 4.14.66+ armv7l
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: armhf
Date: Mon Aug 19 11:10:48 2019
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
tags: | added: next-ddstreet systemd |
tags: |
added: ddstreet disco removed: next-ddstreet |
Changed in systemd (Ubuntu Disco): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in systemd (Ubuntu Bionic): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in systemd (Ubuntu Disco): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu Disco): | |
status: | New → In Progress |
Changed in systemd (Ubuntu Bionic): | |
status: | New → In Progress |
description: | updated |
description: | updated |
description: | updated |
https:/ /github. com/systemd/ systemd/ pull/13352/ commits/ 90ddac6087b5f8f 3736364cfdf698e 713f7e8869. patch