Wrapped journal record corruption on read at recovery - patch attached (was Re: XFS corruption with failover)
Andy Poling
andy at realbig.com
Thu Oct 15 19:36:33 CDT 2009
On Wed, 14 Oct 2009, Christoph Hellwig wrote:
>> 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
Looking at the improved code since 2.6.29, and assuming that the beginning of
the log will always be aligned, I have come up with the attached patch against
2.6.31.4. I think it's cleaner, and it passes my tests.
The bufaddr variable is no longer needed. I removed the xlog_align() after
the second read for both headers and data since the second read will always be
aligned (even if there was no first read) since it is always at the beginning
of the log.
It sets offset to the beginning of the buffer with XFS_BUF_PTR() before the
first read, and then your improved xlog_bread() will update the offset if the
first read had to be re-aligned.
What do you think?
-Andy
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. - Mark Twain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfs_log_recover.pat
Type: image/x-coreldrawpattern
Size: 2297 bytes
Desc: xfs_log_recover.pat
URL: <http://oss.sgi.com/pipermail/xfs/attachments/20091015/0f7e2618/attachment.bin>
More information about the xfs
mailing list