]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
xfs: relog dirty buffers during swapext bmbt owner change
authorBrian Foster <bfoster@redhat.com>
Sun, 17 Sep 2017 21:06:26 +0000 (14:06 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Sep 2017 12:32:02 +0000 (07:32 -0500)
commitbbd9eaf3e665d5bdd630a885feddf4c373d59f32
tree19bdb100fa878df4869b4fc5eac69c78f618101d
parentcd48e41e7238f715378f7fd0c7439f922698ea5e
xfs: relog dirty buffers during swapext bmbt owner change

BugLink: http://bugs.launchpad.net/bugs/1718412
commit 2dd3d709fc4338681a3aa61658122fa8faa5a437 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/xfs/libxfs/xfs_btree.c
fs/xfs/xfs_bmap_util.c