From b8470c94437af94a25b0c2ca358492bdc2e6d3b79ed128faf6d063f985d188c1 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 17 Nov 2023 14:13:03 +0000 Subject: [PATCH 1/3] Accepting request 1127321 from home:goldwynr:branches:Base:System bsc#1207987 - libuuid fix xfs regression for clocks.txt OBS-URL: https://build.opensuse.org/request/show/1127321 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=536 --- ...te-clocks.txt-to-improve-performance.patch | 51 +++++++++++++++++++ util-linux.spec | 2 + 2 files changed, 53 insertions(+) create mode 100644 libuuid-avoid-truncate-clocks.txt-to-improve-performance.patch diff --git a/libuuid-avoid-truncate-clocks.txt-to-improve-performance.patch b/libuuid-avoid-truncate-clocks.txt-to-improve-performance.patch new file mode 100644 index 0000000..23a8bf4 --- /dev/null +++ b/libuuid-avoid-truncate-clocks.txt-to-improve-performance.patch @@ -0,0 +1,51 @@ +From 1d98827edde4b88068d295bbd20c31333b2ad5d4 Mon Sep 17 00:00:00 2001 +From: Goldwyn Rodrigues +Date: Tue, 10 Oct 2023 18:08:59 -0500 +Subject: [PATCH] libuuid: avoid truncate clocks.txt to improve performance + +Instead of explicitly truncating clocks.txt file, pad with +whitespaces in the end of file. +This is done to improve performance of libuuid on xfs +filesystems. Instead of truncating the file, pad it with whitespaces. +This is anyways used as a failsafe method in case truncate fails. + +The reason why this regression was introduced was because of: +869ae85dae64 ("xfs: flush new eof page on truncate to avoid post-eof corruption") + +An attempt to move the clocks.txt to /run (tmpfs) has been attempted before +[1] and with commit ab2e7dd17 ("libuuid: move clock state file from +/var/lib to /var/run"). The latter was reverted. + +[1] https://www.spinics.net/lists/util-linux-ng/msg17331.html + +Signed-off-by: Goldwyn Rodrigues + +diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c +index db793c374..826cd2245 100644 +--- a/libuuid/src/gen_uuid.c ++++ b/libuuid/src/gen_uuid.c +@@ -229,7 +229,6 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, + struct timeval tv; + uint64_t clock_reg; + mode_t save_umask; +- int len; + int ret = 0; + + if (state_fd == -1) +@@ -324,14 +323,10 @@ try_again: + + if (state_fd >= 0) { + rewind(state_f); +- len = fprintf(state_f, +- "clock: %04x tv: %016ld %08ld adj: %08d\n", ++ fprintf(state_f, ++ "clock: %04x tv: %016ld %08ld adj: %08d \n", + clock_seq, (long)last.tv_sec, (long)last.tv_usec, adjustment); + fflush(state_f); +- if (ftruncate(state_fd, len) < 0) { +- fprintf(state_f, " \n"); +- fflush(state_f); +- } + rewind(state_f); + flock(state_fd, LOCK_UN); + } diff --git a/util-linux.spec b/util-linux.spec index 1b1a91b..976ec1b 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -112,6 +112,8 @@ Patch4: 0001-Revert-libblkid-try-LUKS2-first-when-probing.patch Patch5: util-linux-fix-tests-with-64k-pagesize.patch Patch6: use-logind-not-utmp.patch Patch7: setterm-resize-uninit-flags.patch +# bsc#1207987 - regression fix for clock.txt on xfs (upstreamed) +Patch8: libuuid-avoid-truncate-clocks.txt-to-improve-performance.patch BuildRequires: audit-devel BuildRequires: bc From d134d47844cc59d29eec197b2df0bf72b910a2a60bf30534c5bda4d1898eb16a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 28 Nov 2023 11:17:05 +0000 Subject: [PATCH 2/3] Accepting request 1129508 from home:kukuk:branches:Base:System - Remove /etc/filesystem, the content is outdated (/etc cleanup, [jsc#PED-240]) OBS-URL: https://build.opensuse.org/request/show/1129508 OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=537 --- etc_filesystems | 5 ----- util-linux.changes | 6 ++++++ util-linux.spec | 4 ---- 3 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 etc_filesystems diff --git a/etc_filesystems b/etc_filesystems deleted file mode 100644 index a0d3c30..0000000 --- a/etc_filesystems +++ /dev/null @@ -1,5 +0,0 @@ -vfat -hfs -minix -reiserfs -* diff --git a/util-linux.changes b/util-linux.changes index a4c23fc..aa5e4c7 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 28 10:51:47 UTC 2023 - Thorsten Kukuk + +- Remove /etc/filesystem, the content is outdated + (/etc cleanup, [jsc#PED-240]) + ------------------------------------------------------------------- Tue Oct 31 13:20:38 UTC 2023 - Guillaume GARDET diff --git a/util-linux.spec b/util-linux.spec index 976ec1b..5b549d7 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -92,7 +92,6 @@ URL: https://www.kernel.org/pub/linux/utils/util-linux/ Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-%{version}.tar.xz Source2: util-linux-login_defs-check.sh Source3: util-linux-rpmlintrc -Source6: etc_filesystems Source7: baselibs.conf Source8: login.pamd Source9: remote.pamd @@ -570,7 +569,6 @@ sed 's/\bsu\b/runuser/g' <%{SOURCE11} >runuser.default install -m 644 runuser.default %{buildroot}%{_distconfdir}/default/runuser rm -fv "%{buildroot}/%{_sbindir}/raw" "%{buildroot}/sbin/raw" \ "%{buildroot}/%{_mandir}/man8/raw.8"* -install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/filesystems echo -e "#!/bin/sh\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb chmod 755 %{buildroot}%{_sbindir}/flushb @@ -1274,7 +1272,6 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || : %license README.licensing %license COPYING %license Documentation/licenses/* -%config(noreplace) %{_sysconfdir}/filesystems %config(noreplace) %{_sysconfdir}/blkid.conf %{_datadir}/bash-completion/completions/* @@ -1301,7 +1298,6 @@ rmdir --ignore-fail-on-non-empty /run/run >/dev/null 2>&1 || : # Systemd files # ################# %if "%ulsubset" == "systemd" -%exclude %config(noreplace) %{_sysconfdir}/filesystems %exclude %config(noreplace) %{_sysconfdir}/blkid.conf %exclude %config %dir %{_sysconfdir}/issue.d From ad4403d6ffb6d6c711d3a32638913dfbe7c108664e0366ebcd7ba173a3fdac4f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 28 Nov 2023 12:13:00 +0000 Subject: [PATCH 3/3] - Add libuuid-avoid-truncate-clocks.txt-to-improve-performance.patch OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=538 --- util-linux.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util-linux.changes b/util-linux.changes index aa5e4c7..d001a81 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -4,6 +4,11 @@ Tue Nov 28 10:51:47 UTC 2023 - Thorsten Kukuk - Remove /etc/filesystem, the content is outdated (/etc cleanup, [jsc#PED-240]) +------------------------------------------------------------------- +Sat Nov 17 14:05:00 UTC 2023 - Goldwyn Rodrigues + +- Add libuuid-avoid-truncate-clocks.txt-to-improve-performance.patch + ------------------------------------------------------------------- Tue Oct 31 13:20:38 UTC 2023 - Guillaume GARDET