[Top] [All Lists]

Re: Wrapped journal record corruption on read at recovery - patch attach

To: Andy Poling <andy@xxxxxxxxxxx>
Subject: Re: Wrapped journal record corruption on read at recovery - patch attached (was Re: XFS corruption with failover)
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 14 Oct 2009 09:20:30 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, John Quigley <jquigley@xxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.0910131853200.11546@andydesk>
References: <mailman.0.1255458988.141519.xfs@xxxxxxxxxxx> <alpine.DEB.2.00.0910131342440.11546@andydesk> <20091013233324.GA28942@xxxxxxxxxxxxx> <alpine.DEB.2.00.0910131853200.11546@andydesk>
User-agent: Mutt/1.5.19 (2009-01-05)
On Tue, Oct 13, 2009 at 07:29:00PM -0500, Andy Poling wrote:
> Agreed.  I aimed for the smallest possible patch, thinking it might increase
> the likelihood of acceptance.  :-)

Heh.  In the Linux world and especially for this project we don't have
any problem with large fixes as long as they are well-explained and
self-contained, epecially if they are as well-documented as yours.

> I think the complexity here stems from an uncertainty (as we prepare for the
> "second" read) whether there was a first read or not.  As the code reads
> today, if there is data before the end, the first read is done and offset has
> been set.  If not, offset is NULL.
> It seems like the more elegant approach would be to set offset before the
> first read, and then update it if the first read takes place (in case it was
> unaligned).  That also gets rid of bufaddr, and seems like it might read
> better.

Yeah.  Note that in Linux 2.6.29 I did some changes in that are to
take the read and offset calculation into a common helper, so if the
changes become larger we might see some cosmetic difference between
older and newer kernels.

>> I suspect we might even be able to come up with a small enough testcase
>> for this for xfsqa, we just need to make sure logs are aligned and then
>> find a good enough heuristic to reproduce log wrapping.
> I don't know if it would be appropriate in that context, but maybe a tool to
> process an unwrapped log and wrap it would be easier?

We have a tool called loggen to produce log traffic as part of the QA
test suite.  We could try to use it to reproduce this case.  The most
important bit is that we work on a filesystem that actually requires
the alignment bits, that is one using a larger log sector size.  Just
curious, what is the value of sb_logsectlog for your test fs?

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