]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - configure.ac
libxfs: fix atomic64_t poorly for 32-bit architectures
authorDarrick J. Wong <djwong@kernel.org>
Thu, 2 Dec 2021 20:24:33 +0000 (15:24 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 2 Dec 2021 20:24:33 +0000 (15:24 -0500)
commit7448af588a2ea37ec6f96572d616d8832133c97c
treeaeab695462f5a8e0055b01680cfdd7d385930b66
parent27aa80862f6ac7baaaa9b74458e1d6a9c54bc11e
libxfs: fix atomic64_t poorly for 32-bit architectures

In commit de555f66, we converted the atomic64_t implementation to use
the liburcu uatomic_* functions.  Regrettably, nobody tried to build
xfsprogs on a 32-bit architecture (hint: maintainers don't scale well
anymore) so nobody noticed that the build fails due to the unknown
symbol _uatomic_link_error.  This is what happens when liburcu doesn't
know how to perform atomic updates to a variable of a certain size, due
to some horrid macro magic in urcu.h.

Rather than a strict revert to non-atomic updates for these platforms or
(which would introduce a landmine) or roll everything back for the sake
of older platforms, I went with providing a custom atomic64_t
implementation that uses a single pthread mutex.  This enables us to
work around the fact that the kernel atomic64_t API doesn't require a
special initializer function, and is probably good enough since there
are only a handful of atomic64_t counters in the kernel.

Clean up the type declarations of a couple of variables in libxlog to
match the kernel usage, though that's probably overkill.

Eventually we'll want to decide if we're deprecating 32-bit, but this
fixes them in the mean time.

[sandeen: make the custom atomic64_add() take an int64_t]

Fixes: de555f66 ("atomic: convert to uatomic")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
configure.ac
include/atomic.h
include/builddefs.in
include/libxlog.h
libxfs/init.c
m4/package_urcu.m4
repair/phase2.c