summaryrefslogtreecommitdiff
path: root/fs/eventfd.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-04-08 16:50:56 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-04-29 16:40:30 -0700
commite6e7790972df86876010987f8b36b79ab2754a83 (patch)
tree2680b4fb41dda300cc2e49cdea54d545d6429db3 /fs/eventfd.c
parent73b7d4cccdb4dccc2e2f167019dc95b7828c8124 (diff)
xfs: use a separate frextents counter for rt extent reservationsxfs-merge-5.19_2022-04-29
As mentioned in the previous commit, the kernel misuses sb_frextents in the incore mount to reflect both incore reservations made by running transactions as well as the actual count of free rt extents on disk. This results in the superblock being written to the log with an underestimate of the number of rt extents that are marked free in the rtbitmap. Teaching XFS to recompute frextents after log recovery avoids operational problems in the current mount, but it doesn't solve the problem of us writing undercounted frextents which are then recovered by an older kernel that doesn't have that fix. Create an incore percpu counter to mirror the ondisk frextents. This new counter will track transaction reservations and the only time we will touch the incore super counter (i.e the one that gets logged) is when those transactions commit updates to the rt bitmap. This is in contrast to the lazysbcount counters (e.g. fdblocks), where we know that log recovery will always fix any incorrect counter that we log. As a bonus, we only take m_sb_lock at transaction commit time. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/eventfd.c')
0 files changed, 0 insertions, 0 deletions