Merge ~lvoytek/ubuntu/+source/libqb:posix-fallocate-retry-jammy into ubuntu/+source/libqb:ubuntu/jammy-devel

Proposed by Lena Voytek
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: 54fd08af5e6607fdfdb56fa4192f0dfcb0acc458
Proposed branch: ~lvoytek/ubuntu/+source/libqb:posix-fallocate-retry-jammy
Merge into: ubuntu/+source/libqb:ubuntu/jammy-devel
Diff against target: 82 lines (+60/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/retry-if-posix-fallocate-interrupted-eintr.patch (+52/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Andreas Hasenack Approve
Canonical Server Reporter Pending
Canonical Server Pending
Review via email: mp+425251@code.launchpad.net

Description of the change

SRUing a fix from kinetic and upstream that retries posix_fallocate when it fails from time to time. This fix was confirmed to work by the reporter.

PPA: ppa:lvoytek/libqb-retry-posix-fallocate-jammy

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Looks good, just a version fix and suggested change to the wording of the patch description.

review: Needs Fixing
Revision history for this message
Lena Voytek (lvoytek) wrote :

Updated, thanks!

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

+1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Sponsored:

$ dput ubuntu ../libqb_2.0.4-1ubuntu0.1_source.changes
Uploading libqb using ftp to ubuntu (host: upload.ubuntu.com; directory: /ubuntu)
running gitubuntu: Warn if uploading without git-ubuntu Vcs-* entries.
running releasemismatch: Warn about mismatching suffixesg e.g. focal with a XX.YY not being 20.04
running badauthor: Stop if uploading with root@ or ubuntu@ email adresses.
running checksum: verify checksums before uploading
running check-debs: makes sure the upload contains a binary package
running nobug: Stop if uploading without any bug reference.
running gpg: check GnuPG signatures before the upload
running required-fields: check whether a field is present and non-empty in the changes file
running supported-distribution: check whether the target distribution is currently supported (using distro-info)
{'allowed': ['release', 'proposed', 'backports', 'security'], 'known': ['release', 'proposed', 'updates', 'backports', 'security']}
running ppaforppaonly: Stop uploads to the archive with or to ppa without ~ppa suffix.
running placeholderbug: Stop if using common placeholder numbers as bug reference.
running updatemaintainer: Stop if ubuntu changes are without ubuntu maintainer.
running suite-mismatch: check the target distribution for common errors
Uploading libqb_2.0.4-1ubuntu0.1.dsc
Uploading libqb_2.0.4-1ubuntu0.1.debian.tar.xz
Uploading libqb_2.0.4-1ubuntu0.1_source.buildinfo
Uploading libqb_2.0.4-1ubuntu0.1_source.changes

Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: ahasenack, lvoytek
Uploaders: ahasenack
MP auto-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 33d5484..d93fb07 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+libqb (2.0.4-1ubuntu0.1) jammy; urgency=medium
7+
8+ * d/p/retry-if-posix-fallocate-interrupted-eintr.patch: Retry posix_fallocate
9+ when the error - couldn't create file for mmap - occurs (LP: #1978955)
10+
11+ -- Lena Voytek <lena.voytek@canonical.com> Wed, 22 Jun 2022 11:52:46 -0700
12+
13 libqb (2.0.4-1build1) jammy; urgency=high
14
15 * No change rebuild for ppc64el baseline bump.
16diff --git a/debian/patches/retry-if-posix-fallocate-interrupted-eintr.patch b/debian/patches/retry-if-posix-fallocate-interrupted-eintr.patch
17new file mode 100644
18index 0000000..58c5b38
19--- /dev/null
20+++ b/debian/patches/retry-if-posix-fallocate-interrupted-eintr.patch
21@@ -0,0 +1,52 @@
22+Description: Retry a few times if posix_fallocate fails with EINTR
23+ Pacemaker sometimes returns errors during posix_fallocate that can cause a crash.
24+ The function will be retried up to five times to help avoid the crash.
25+Author: Jakub Jankowski <shasta@toxcorp.com>
26+Origin: upstream, https://github.com/ClusterLabs/libqb/pull/453/commits/2e259c9d6e13968665678745f1e774bc4ccf8806
27+Bug: https://github.com/ClusterLabs/libqb/issues/451
28+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libqb/+bug/1978955
29+Bug-SUSE: https://www.suse.com/support/kb/doc/?id=000020566
30+Last-Update: 2022-06-17
31+---
32+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
33+--- a/lib/unix.c
34++++ b/lib/unix.c
35+@@ -81,6 +81,9 @@
36+ int32_t i;
37+ #endif
38+ char *is_absolute = strchr(file, '/');
39++#ifdef HAVE_POSIX_FALLOCATE
40++ int32_t fallocate_retry = 5;
41++#endif
42+
43+ if (is_absolute) {
44+ (void)strlcpy(path, file, PATH_MAX);
45+@@ -121,12 +124,22 @@
46+ }
47+ #endif
48+ #ifdef HAVE_POSIX_FALLOCATE
49+- if ((res = posix_fallocate(fd, 0, bytes)) != 0) {
50+- errno = res;
51+- res = -1 * res;
52+- qb_util_perror(LOG_ERR, "couldn't allocate file %s", path);
53+- goto unlink_exit;
54+- }
55++ /* posix_fallocate(3) can be interrupted by a signal,
56++ so retry few times before giving up */
57++ do {
58++ fallocate_retry--;
59++ res = posix_fallocate(fd, 0, bytes);
60++ if (res == EINTR) {
61++ qb_util_log(LOG_DEBUG, "got EINTR trying to allocate file %s, retrying...", path);
62++ continue;
63++ } else if (res != 0) {
64++ errno = res;
65++ res = -1 * res;
66++ qb_util_perror(LOG_ERR, "couldn't allocate file %s", path);
67++ goto unlink_exit;
68++ }
69++ break;
70++ } while (fallocate_retry > 0);
71+ #else
72+ if (file_flags & O_CREAT) {
73+ long page_size = sysconf(_SC_PAGESIZE);
74diff --git a/debian/patches/series b/debian/patches/series
75index 473ff30..66a45af 100644
76--- a/debian/patches/series
77+++ b/debian/patches/series
78@@ -3,3 +3,4 @@ hurd-definition-of-PATH_MAX-must-be-included-separately.patch
79 tests-always-run-the-SHM-suite-just-expect-failures.patch
80 hurd-the-socket-tests-are-expected-to-fail.patch
81 Fix-typos-and-inconsistencies-in-doxygen2man-help-text.patch
82+retry-if-posix-fallocate-interrupted-eintr.patch

Subscribers

People subscribed via source and target branches