xfs: create shadow transaction reservations for computing minimum log size
authorDarrick J. Wong <djwong@kernel.org>
Tue, 26 Apr 2022 01:38:13 +0000 (18:38 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 28 Apr 2022 17:25:15 +0000 (10:25 -0700)
commit52d8ea4f2406c14d632a0e7f816bbb18d8c3e9ed
tree7d4b48f56a99f46a5756b8e8667581c5cc776a08
parentf1e6a8d72806d2d57560b4873d8aa42c420384ee
xfs: create shadow transaction reservations for computing minimum log size

Every time someone changes the transaction reservation sizes, they
introduce potential compatibility problems if the changes affect the
minimum log size that we validate at mount time.  If the minimum log
size gets larger (which should be avoided because doing so presents a
serious risk of log livelock), filesystems created with old mkfs will
not mount on a newer kernel; if the minimum size shrinks, filesystems
created with newer mkfs will not mount on older kernels.

Therefore, enable the creation of a shadow log reservation structure
where we can "undo" the effects of tweaks when computing minimum log
sizes.  These shadow reservations should never be used in practice, but
they insulate us from perturbations in minimum log size.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_log_rlimit.c
fs/xfs/xfs_trace.h