Re: [PATCH 25/25] xfs: add write verifiers to log recovery

Phil White
2012-10-30T17:56:07Z

On Thu, Oct 25, 2012 at 05:34:14PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> Log recovery reads metadata, modifies it and rewrites it to disk.
> It is only practical to add write verifiers to metadata buffers
> because we do not know the type of the buffer prior to reading it
> from disk. Further, if it is an new bufer, the contents might not
> contain anything we can verify. Hence we only attempt to verify
> after the buffer changes have been replayed and we can peek at the
> buffer to find out what it contains to attached the correct
> verifier. This ensures that we don't introduce gross corruptions as
> a result of replaying transactions in the log.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
> fs/xfs/xfs_alloc.c | 2 +-
> fs/xfs/xfs_alloc.h | 1 +
> fs/xfs/xfs_alloc_btree.c | 15 ++++---
> fs/xfs/xfs_da_btree.h | 1 +
> fs/xfs/xfs_dir2_leaf.c | 2 +-
> fs/xfs/xfs_dir2_node.c | 2 +-
> fs/xfs/xfs_dir2_priv.h | 3 ++
> fs/xfs/xfs_dquot.c | 17 +++++++-
> fs/xfs/xfs_dquot.h | 2 +
> fs/xfs/xfs_log_recover.c | 104 +++++++++++++++++++++++++++++++++++++++++++++-
> 10 files changed, 138 insertions(+), 11 deletions(-)

Generally, a good read. It kept me on the edge of my seat.

Reviewed-by: Phil White <pwhite@sgi.com>