Skip to content

xfs: log recovery torn write detection

Brian Foster linux-xfs 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 0 repliesNew
  2. v18 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Fixed bug in first bad record detection to return correct block when log wraps.
- Update torn record handling to truncate back to tail.
- Fixed up warning messages.
- Replaced v1 error injection mechanism with log write time CRC error injection.
v1: http://oss.sgi.com/pipermail/xfs/2015-November/044841.html
- 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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8xfs: detect and handle invalid iclog size set by mkfsfs/xfs/xfs_log_recover.c+25 -10 replies
2/8xfs: refactor log record unpack and data processingfs/xfs/xfs_log_recover.c+23 -120 replies
3/8xfs: refactor and open code log record crc checkfs/xfs/xfs_log_recover.c+26 -460 replies
4/8xfs: return start block of first bad log record during recoveryfs/xfs/xfs_log_recover.c+16 -40 replies
5/8xfs: support a crc verification only log record passfs/xfs/libxfs/xfs_log_recover.h fs/xfs/xfs_log_recover.c+20 -50 replies
6/8xfs: refactor log record start detection into a new helperfs/xfs/xfs_log_recover.c+83 -350 replies
7/8xfs: detect and trim torn writes during log recoveryfs/xfs/xfs_log_recover.c+287 -190 replies
8/8xfs: debug mode log record crc error injectionfs/xfs/xfs_log.c fs/xfs/xfs_log_priv.h fs/xfs/xfs_sysfs.c+77 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/8] xfs: log recovery torn write detection

Hi all,

Here's v2 of log recovery torn write detection. This fixes a couple bugs as noted in the replies to the v1 series and replaces the error injection mechanism with an alternate version that actually writes an invalid log record CRC to disk. An xfstests test based on this mechanism is forthcoming.

This survives xfstests and runs through a significant number of error injection iterations without any related problems. I have seen one or two assert failures and whatnot that do not appear related to this series and so far are not repeatable. Thoughts, reviews, flames appreciated.

Brian

v2:
- Fixed bug in first bad record detection to return correct block when log wraps.
- Update torn record handling to truncate back to tail.
- Fixed up warning messages.
- Replaced v1 error injection mechanism with log write time CRC error injection.
v1: http://oss.sgi.com/pipermail/xfs/2015-November/044841.html
- 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 record crc error injection

 fs/xfs/libxfs/xfs_log_recover.h |   1 +
 fs/xfs/xfs_log.c                |  45 +++-
 fs/xfs/xfs_log_priv.h           |   3 +
 fs/xfs/xfs_log_recover.c        | 569 ++++++++++++++++++++++++++++++++--------
 fs/xfs/xfs_sysfs.c              |  36 +++
 5 files changed, 541 insertions(+), 113 deletions(-)
Signature · 6 lines
2.1.0

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs