xfs
[Top] [All Lists]

Re: [PATCH v3] xfsdump: enable dump header checksums

To: Bill Kendall <wkendall@xxxxxxx>
Subject: Re: [PATCH v3] xfsdump: enable dump header checksums
From: Alex Elder <aelder@xxxxxxx>
Date: Wed, 21 Sep 2011 12:27:20 -0500
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <1316625223-19970-1-git-send-email-wkendall@xxxxxxx>
References: <1316625223-19970-1-git-send-email-wkendall@xxxxxxx>
Reply-to: <aelder@xxxxxxx>
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@xxxxxxx>
> ---
> 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@xxxxxxx>


<Prev in Thread] Current Thread [Next in Thread>