]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - Makefile
xfs_copy: check for dirty log on non-duplicate copies
authorBrian Foster <bfoster@redhat.com>
Tue, 13 Oct 2015 23:58:25 +0000 (10:58 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 13 Oct 2015 23:58:25 +0000 (10:58 +1100)
commit3616eb86d0c4a6f57ef73520949827a8dace6852
tree0e236eeed517df6ff9f4bb243bb725690afeeb10
parent1c12a8148b6873f1939f84c3915e6af3cbb382f8
xfs_copy: check for dirty log on non-duplicate copies

xfs_copy either copies the log as-is or formats the log of the target(s)
based on whether duplicate copy mode is enabled. The target log is
formatted when non-duplicate mode is enabled because copies gain a new
fs UUID and the new UUID must be stamped into the log.

When non-duplicate mode is enabled, however, xfs_copy does not check
whether the source filesystem log is actually clean. If the source log
is dirty, the target filesystem is silently created with a clean log and
thus ends up in a potentially corrupted state.

Update xfs_copy to check the source log state and fail the copy if in
non-duplicate mode and the log is dirty. Encourage the user to mount the
filesystem or run xfs_repair to clear the log. Note that the log is
scanned unconditionally as opposed to only in non-duplicate mode because
v5 superblock log format support requires the current cycle number to
format the log correctly.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Makefile
copy/Makefile
copy/xfs_copy.c