xfs
[Top] [All Lists]

Re: [PATCH 4/4] xfs: only run torn log write detection on dirty logs

To: "Brian Foster" <bfoster@xxxxxxxxxx>
Subject: Re: [PATCH 4/4] xfs: only run torn log write detection on dirty logs
From: "Jan Beulich" <JBeulich@xxxxxxxx>
Date: Fri, 04 Mar 2016 05:49:50 -0700
Cc: <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1457008798-58734-5-git-send-email-bfoster@xxxxxxxxxx>
References: <1457008798-58734-1-git-send-email-bfoster@xxxxxxxxxx> <1457008798-58734-5-git-send-email-bfoster@xxxxxxxxxx>
>>> On 03.03.16 at 13:39, <bfoster@xxxxxxxxxx> wrote:
> XFS uses CRC verification over a sub-range of the head of the log to
> detect and handle torn writes. This torn log write detection currently
> runs unconditionally at mount time, regardless of whether the log is
> dirty or clean. This is problematic in cases where a filesystem might
> end up being moved across different, incompatible (i.e., opposite
> byte-endianness) architectures.
> 
> The problem lies in the fact that log data is not necessarily written in
> an architecture independent format. For example, certain bits of data
> are written in native endian format. Further, the size of certain log
> data structures differs (i.e., struct xlog_rec_header) depending on the
> word size of the cpu. This leads to false positive crc verification
> errors and ultimately failed mounts when a cleanly unmounted filesystem
> is mounted on a system with an incompatible architecture from data that
> was written near the head of the log.
> 
> Update the log head/tail discovery code to run torn write detection only
> when the log is not clean. This means something other than an unmount
> record resides at the head of the log and log recovery is imminent. It
> is a requirement to run log recovery on the same type of host that had
> written the content of the dirty log and therefore CRC failures are
> legitimate corruptions in that scenario.
> 
> Reported-by: Jan Beulich <JBeulich@xxxxxxxx>
> Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>

Tested-by: Jan Beulich <JBeulich@xxxxxxxx>

Thank you Brian.

Jan

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