From 9b94bfd593d7c8c50aec64903425a0afd47e2fdd Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Jul 07 2021 21:49:07 +0000 Subject: Merge branch 'c8s' into c8s-sig-hyperscale-experimental Merge librepo-1.14.0-2.el8 and rebuild for Hyperscale --- diff --git a/SOURCES/0001-Recover-from-fsync-fail-on-read-only-filesystem-RhBu.patch b/SOURCES/0001-Recover-from-fsync-fail-on-read-only-filesystem-RhBu.patch new file mode 100644 index 0000000..637f081 --- /dev/null +++ b/SOURCES/0001-Recover-from-fsync-fail-on-read-only-filesystem-RhBu.patch @@ -0,0 +1,44 @@ +From 33be80700bc594f34818ce697493c17e70430390 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= +Date: Mon, 17 May 2021 08:50:25 +0200 +Subject: [PATCH] Recover from fsync fail on read-only filesystem + (RhBug:1956361) + +When `fsync` fails due to the file not supporting synchronization just log +the problem instead of failing the whole dnf run. This happens for +example with filesystems mounted read-only in which case there is no +point to `fsync` anyway. + +Currently we also ignore return values from `FSETXATTR` which also fails +on read-only filesystem (so no checksum cache is set). This is fine however +since the checksum is recomputed when needed, dnf is just a bit slower. + +https://bugzilla.redhat.com/show_bug.cgi?id=1956361 +--- + librepo/checksum.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/librepo/checksum.c b/librepo/checksum.c +index db37040..6bba53c 100644 +--- a/librepo/checksum.c ++++ b/librepo/checksum.c +@@ -266,9 +266,13 @@ lr_checksum_fd_compare(LrChecksumType type, + *matches = (strcmp(expected, checksum)) ? FALSE : TRUE; + + if (fsync(fd) != 0) { +- g_set_error(err, LR_CHECKSUM_ERROR, LRE_FILE, +- "fsync failed: %s", strerror(errno)); +- return FALSE; ++ if (errno == EROFS || errno == EINVAL) { ++ g_debug("fsync failed: %s", strerror(errno)); ++ } else { ++ g_set_error(err, LR_CHECKSUM_ERROR, LRE_FILE, ++ "fsync failed: %s", strerror(errno)); ++ return FALSE; ++ } + } + + if (caching && *matches && timestamp != -1) { +-- +2.31.1 + diff --git a/SPECS/librepo.spec b/SPECS/librepo.spec index ca5f4e3..583d9ed 100644 --- a/SPECS/librepo.spec +++ b/SPECS/librepo.spec @@ -12,7 +12,7 @@ Name: librepo Version: 1.14.0 -Release: 1.1%{?dist} +Release: 2.1%{?dist} Summary: Repodata downloading library License: LGPLv2+ @@ -24,6 +24,8 @@ Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Provides: librepo(pr234) Provides: librepo(pr211) +Patch1: 0001-Recover-from-fsync-fail-on-read-only-filesystem-RhBu.patch + # Unmerged Patch9999: https://github.com/rpm-software-management/librepo/pull/222.patch Provides: librepo(pr222) @@ -106,9 +108,15 @@ Python 3 bindings for the librepo library. %{python3_sitearch}/%{name}/ %changelog +* Wed Jul 07 2021 Davide Cavalca - 1.14.0-2.1 +- Rebuild for Hyperscale + * Mon Jun 28 2021 Matthew Almond - 1.14.0-1.1 - Merge 1.14.0 update into hsx branch +* Fri Jun 25 2021 Marek Blaha - 1.14.0-2 +- Recover from fsync fail on read-only filesystem (RhBug:1956361) + * Fri Apr 30 2021 Pavla Kratochvilova - 1.14.0-1 - Update to 1.14.0 - Fix the key string parsing in url_substitution