[PATCH v3] xfsdump: enable dump header checksums

Alex Elder aelder at sgi.com
Wed Sep 21 12:27:20 CDT 2011


On Wed, 2011-09-21 at 12:13 -0500, Bill Kendall wrote:
> Various structures in a dump file optionally contain a checksum, but
> the code to compute and validate the checksum has not been enabled.
> The checksum code has a negligible performance impact and so this
> patch enables the checksum code unconditionally. Also:
> 
> - make sure all header sizes are multiples of 4 bytes
>   (a requirement of the checksum routine)
> - zero structures to ensure internal padding has a known value
> - fix a bug in dump_extattr_buildrecord() which checksummed
>   the wrong header structure
> - add calc_checksum() and is_checksum_valid() routines to
>   cut down on duplicate code
> 
> Signed-off-by: Bill Kendall <wkendall at sgi.com>
> ---
> Changes since v2:
>     - Add an ASSERT in the checksum routines to enforce the
>       multiple of 4 requirement, rather than checking at
>       init (which may not catch all checksum users).
>     - Remove unnecessary cast from void * to u_int32_t *.
>     - Calculate endp different to avoid having to cast to
>       void * or char *.
> 
>  common/content_inode.h |   27 ++++++++++++++++
>  dump/content.c         |   78 +++++++----------------------------------------
>  restore/Makefile       |    2 +-
>  restore/content.c      |   40 ++----------------------
>  4 files changed, 44 insertions(+), 103 deletions(-)

Looks good.

Reviewed-by: Alex Elder <aelder at sgi.com>





More information about the xfs mailing list