]> 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>
Fri, 24 Nov 2023 10:19:19 +0000 (11:19 +0100)
commitece194082fb318d0fa3fec31193ce6f61b97c67a
tree8969a3c8286c732bfd7dccf4c5926188df1a051b
parent84a62c1a5a614bde2530544bf2558c73f0179d42
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