From: Brian Foster <bfoster@redhat.com>
To: xfs@oss.sgi.com
Subject: [PATCH 0/8] xfs: log recovery torn write detection
Date: Mon, 9 Nov 2015 15:21:07 -0500 [thread overview]
Message-ID: <1447100475-33465-1-git-send-email-bfoster@redhat.com> (raw)
Hi all,
Here's a first real pass at XFS log recovery torn write detection. This
series has been tested via xfstests and via repetitive fsstress/shutdown
sequences followed by simulated CRC errors on log recovery. The latter
testing has proven useful in shaking out a few bugs, but I have still
reproduced fs inconsistency after a couple hundred iterations or so.
That said, I suspect the problems at this point are either actual
logging problems (e.g., all of the EFI/EFD logging patches and whatnot
originated from this kind of testing) or due to the nature of the error
simulation.
In short, it simulates log corruption moreso than torn writes because it
injects errors at recovery time. The log buffers are written
successfully at shutdown time and therefore I believe it's still
possible for the filesystem to have modifications that depend on
committed transactions (which are ultimately skipped if a crc error is
simulated). I've marked this patch RFC for the time being because I'd
like to try and come up with something a bit more deterministic, if
possible (so long as it can be done reasonably simply). For example,
perhaps we can replace it with a similar debug mode that intentionally
corrupts a crc at write time and shuts down the fs on write completion
such that the AIL is not updated and there is less risk of inconsistency
due to writing back metadata items in the "corrupted" log buffer(s).
Anyways, the current patch is included so the current test procedure is
documented, reviewable and repeatable.
Patch 1 is a bug fix for a problem exposed by this mechanism. Patches
2-6 are primarily refactoring and introduce the CRC-check-only log
recovery pass. Patch 7 enables log head/tail torn write detection. Patch
8 implements the DEBUG mode error injection mechanism described above.
Thoughts, reviews, flames appreciated.
Brian
v1:
- Added bug fix for mkfs log record header inconsistency.
- Refactored log recovery code to support a CRC-check-only recovery
pass.
- CRC verify the last 8 records behind the head to account for
concurrent log writes.
- Verify the tail of the log as well when the head is torn.
- Added (rfc) crc error injection patch for testing purposes.
rfc: http://oss.sgi.com/pipermail/xfs/2015-July/042415.html
Brian Foster (8):
xfs: detect and handle invalid iclog size set by mkfs
xfs: refactor log record unpack and data processing
xfs: refactor and open code log record crc check
xfs: return start block of first bad log record during recovery
xfs: support a crc verification only log record pass
xfs: refactor log record start detection into a new helper
xfs: detect and trim torn writes during log recovery
xfs: debug mode log recovery crc error injection
fs/xfs/libxfs/xfs_log_recover.h | 1 +
fs/xfs/xfs_globals.c | 1 +
fs/xfs/xfs_log_recover.c | 646 +++++++++++++++++++++++++++++++++-------
fs/xfs/xfs_sysctl.h | 1 +
fs/xfs/xfs_sysfs.c | 31 ++
5 files changed, 574 insertions(+), 106 deletions(-)
--
2.1.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2015-11-09 20:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 20:21 Brian Foster [this message]
2015-11-09 20:21 ` [PATCH 1/8] xfs: detect and handle invalid iclog size set by mkfs Brian Foster
2015-11-09 20:21 ` [PATCH 2/8] xfs: refactor log record unpack and data processing Brian Foster
2015-11-09 20:21 ` [PATCH 3/8] xfs: refactor and open code log record crc check Brian Foster
2015-11-09 20:21 ` [PATCH 4/8] xfs: return start block of first bad log record during recovery Brian Foster
2015-11-10 15:42 ` Brian Foster
2015-11-09 20:21 ` [PATCH 5/8] xfs: support a crc verification only log record pass Brian Foster
2015-11-09 20:21 ` [PATCH 6/8] xfs: refactor log record start detection into a new helper Brian Foster
2015-11-09 20:21 ` [PATCH 7/8] xfs: detect and trim torn writes during log recovery Brian Foster
2015-11-10 13:45 ` Brian Foster
2015-11-09 20:21 ` [PATCH RFC 8/8] xfs: debug mode log recovery crc error injection Brian Foster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447100475-33465-1-git-send-email-bfoster@redhat.com \
--to=bfoster@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox