xfs
[Top] [All Lists]

Re: [PATCH 1/2] xfs: btree block LSN escaping to disk uninitialised

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/2] xfs: btree block LSN escaping to disk uninitialised
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Wed, 28 Aug 2013 15:31:09 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1377688967-6480-2-git-send-email-david@xxxxxxxxxxxxx>
References: <1377688967-6480-1-git-send-email-david@xxxxxxxxxxxxx> <1377688967-6480-2-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 08/28/13 06:22, Dave Chinner wrote:
From: Dave Chinner<dchinner@xxxxxxxxxx>

When testing LSN ordering code for v5 superblocks, it was discovered
that the the LSN embedded in the generic btree blocks was
occasionally uninitialised. These values didn't get written to disk
by metadata writeback - they got written by previous transactions in
log recovery.

The issue is here that the when the block is first allocated and
initialised, the LSN field was not initialised - it gets overwritten
before IO is issued on the buffer - but the value that is logged by
transactions that modify the header before it is written to disk
(and initialised) contain garbage. Hence the first recovery of the
buffer will stamp garbage into the LSN field, and that can cause
subsequent transactions to not replay correctly.

The fix is simply to initialise the bb_lsn field to zero when we
initialise the block for the first time.

Signed-off-by: Dave Chinner<dchinner@xxxxxxxxxx>
---


This is simple enough that it could have been put into the second patch.

Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>

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