]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs: use an incore rtgroup rotor for rtpick
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:22:04 +0000 (14:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 31 Jul 2024 01:46:51 +0000 (18:46 -0700)
commit194a80ebc31cc0b2772bac182b90ca777ed4a165
tree816b4b40e89a1a7419c36b2c92da2aa150f8b367
parent340324c18dcd6e0a664b235ae4420061c10e4471
xfs: use an incore rtgroup rotor for rtpick

During the 6.7 merge window, Linus noticed that the realtime allocator
was doing some sketchy things trying to encode a u64 sequence counter
into the rtbitmap file's atime.  The sketchy casting of a struct pointer
to a u64 pointer has subtly broken several times over the past decade as
the codebase has transitioned to using the VFS i_atime field and that
field has changed in size and layout over time.

Since the goal of the rtpick code is to _suggest_ a starting place for
new rt file allocations, the repeated breakage has not resulted in
inconsistent metadata.  IOWs, it's a hint.

For rtgroups, we don't need this complex code to cut the rtextents space
into fractions.  Add an rtgroup rotor and use that for rtpick, similar
to AG rotoring on the data device.  The new rotor does not persist,
which reduces the logging overhead slightly.

Between this and the new restrictions on open-by-handle on metadir, it's
no longer possible for userspace to control the rtpick rotor.

Link: https://lore.kernel.org/linux-xfs/CAHk-=wj3oM3d-Hw2vvxys3KCZ9De+gBN7Gxr2jf96OTisL9udw@mail.gmail.com/
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
include/xfs_mount.h
libxfs/xfs_rtbitmap.c
mkfs/proto.c