]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: relog dirty buffers during swapext bmbt owner change
authorBrian Foster <bfoster@redhat.com>
Wed, 18 Oct 2017 18:39:01 +0000 (13:39 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 18 Oct 2017 18:39:01 +0000 (13:39 -0500)
commit38fa71a753bea4226273e80ad1dff16027ef7591
tree70b43c5ba8cf9d18962b782e5b20e2684479b1d6
parentc7ba17315eb31f38d56a3f445ef799e145331677
xfs: relog dirty buffers during swapext bmbt owner change

Source kernel commit: 2dd3d709fc4338681a3aa61658122fa8faa5a437

The owner change bmbt scan that occurs during extent swap operations
does not handle ordered buffer failures. Buffers that cannot be
marked ordered must be physically logged so previously dirty ranges
of the buffer can be relogged in the transaction.

Since the bmbt scan may need to process and potentially log a large
number of blocks, we can't expect to complete this operation in a
single transaction. Update extent swap to use a permanent
transaction with enough log reservation to physically log a buffer.
Update the bmbt scan to physically log any buffers that cannot be
ordered and to terminate the scan with -EAGAIN. On -EAGAIN, the
caller rolls the transaction and restarts the scan. Finally, update
the bmbt scan helper function to skip bmbt blocks that already match
the expected owner so they are not reprocessed after scan restarts.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
[darrick: fix the xfs_trans_roll call]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
[dchinner: proper userspace libxfs_trans_ordered_buf]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/xfs_trans.h
libxfs/libxfs_api_defs.h
libxfs/libxfs_priv.h
libxfs/trans.c
libxfs/xfs_btree.c