]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libuuid: avoid truncate clocks.txt to improve performance
authorGoldwyn Rodrigues <rgoldwyn@suse.de>
Tue, 10 Oct 2023 23:08:59 +0000 (18:08 -0500)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Nov 2023 13:52:50 +0000 (14:52 +0100)
commit1d98827edde4b88068d295bbd20c31333b2ad5d4
treea3de32c60f2982a23d8a12716c705f657bb89519
parent8d7d7ac070c2d18165ab9f8e019bbbd18f724942
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 <rgoldwyn@suse.com>
libuuid/src/gen_uuid.c