]> www.infradead.org Git - users/hch/xfsprogs.git/commit
db/metadump: bump lsn when log is cleared on v5 supers
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)
commit1c12a8148b6873f1939f84c3915e6af3cbb382f8
treed09d09437b8e9e1357e4b0a25a0d20464f3ab897
parent7f725646baa74978e210456daf7a6a0e92284e11
db/metadump: bump lsn when log is cleared on v5 supers

xfs_metadump handles the log in different ways depending on the mode of
operation. If the log is dirty or obfuscation and stale data zeroing are
disabled, the log is copied as is. In all other scenarios, the log is
explicitly zeroed. This is incorrect for version 5 superblocks where the
current LSN is always expected to be ahead of all fs metadata.

Update metadump to use libxfs_log_clear() to format the log with an
elevated LSN rather than zero the log and reset the current the LSN.
Metadump does not use buffers for the dump target, instead using a
cursor implementation to access the log via a single memory buffer.
Therefore, update libxfs_log_clear() to receive an optional (but
exclusive to the buftarg parameter) memory buffer pointer for the log.
If the pointer is provided, the log format is written out to this
buffer. Otherwise, fall back to the original behavior and access the log
through buftarg buffers.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/metadump.c
db/sb.c
include/libxfs.h
libxfs/rdwr.c
mkfs/xfs_mkfs.c
repair/phase2.c
repair/xfs_repair.c