]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_mdrestore: don't allow restoring onto zoned block devices
authorChristoph Hellwig <hch@lst.de>
Mon, 12 May 2025 13:17:37 +0000 (15:17 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 28 May 2025 10:17:39 +0000 (12:17 +0200)
commit1bee63ac33e4ddfcc7f443d9b8f507d49cab4948
tree76f4233ee241405855cd19960db385e910c90ce8
parentec9909785b860d8c3227a98981c82951a0182202
xfs_mdrestore: don't allow restoring onto zoned block devices

The way mdrestore works is not very amendable to zone devices.  The code
that checks the device size tries to write to the highest offset, which
doesn't match the write pointer of a clean zone device.  And while that
is relatively easily fixable, the metadata for each RTG records the
highest written offset, and the mount code compares that to the hardware
write pointer, which will mismatch.  This could be fixed by using write
zeroes to pad the RTG until the expected write pointer, but this turns
the quick metadata operation that mdrestore is supposed to be into
something that could take hours on HDD.

So instead error out when someone tries to mdrestore onto a zoned device
to clearly document that this won't work.  Doing a mdrestore into a file
still works perfectly fine, and we might look into a new mdrestore option
to restore into a set of files suitable for the zoned loop device driver
to make mdrestore fully usable for debugging.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
mdrestore/xfs_mdrestore.c