All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Lowmem mode fsck fixes with fsck-tests framework update
@ 2017-01-23  9:13 Qu Wenruo
  2017-01-23  9:13 ` [PATCH 1/9] btrfs-progs: lowmem check: Fix wrong block group check when search slot points to slot beyong leaf Qu Wenruo
                   ` (10 more replies)
  0 siblings, 11 replies; 29+ messages in thread
From: Qu Wenruo @ 2017-01-23  9:13 UTC (permalink / raw)
  To: linux-btrfs; +Cc: calestyo, chris, dsterba

Patches can be fetch from github:
https://github.com/adam900710/btrfs-progs/tree/lowmem_fixes

Although there are near 10 patches, but they are all small.
No need to be scared. :)

Thanks for reports from Chris Murphy and Christoph Anton Mitterer,
several new bugs are exposed for lowmem mode fsck.

And one original mode bug, not fixed in this patchset.
The original mode bug is caused by fsck/006, which repairs doesn't
fix backrefs of a data extent, which lowmem mode detects it correctly.

1) Block group used space false alert
   If a BLOCK_GROUP_ITEM or its first EXTENT/METADATA_ITEM is located at
   the first slot of a leaf, search_slot() used by lowmem mode can
   point to previous leaf, with path->slots[0] beyond valid leaf slots.

   This makes us to read out uninitialized data, and can abort block
   group used space check loop, causing a false alert.

   Fix it with a test case image inside fsck-tests/020/extent-ref-cases
   Reported by Christoph.

2) Partly written prealloc extent false alert
   If a prealloc extent gets partily written, lowmem mode will report
   prealloc extent shouldn't have csum.

   Lowmem mode passed wrong variable to csum checking code, causing it
   to check the whole range of the prealloc extent, making the bug
   happens.

   Fix it with a test case inside fsck-tests/020/extent-ref-cases.
   Reported by Chirs Murphy And Christoph.

3) Extent item size false alert.
   Under certain case, btrfs lowmem mode check reports data backref
   lost.
   It's because newly introduced extent item size check aborts normal
   check routine.

   It can happen if a data/metadata extent item has no inline ref.

   Fix it, test case already submitted before and merged, but due to
   fsck-tests framework bugs, it never get called for lowmem mode.

4) fsck-tests Lowmem mode override fixes
   Allow lowmem mode override to get called for all tests, and allow
   them all to pass lowmem mode except fsck-tests/006, which is a
   original repair mode bug.


Lu Fengqi (1):
  btrfs-progs: fsck: Fix lowmem mode override to allow it skip repair
    work

Qu Wenruo (8):
  btrfs-progs: lowmem check: Fix wrong block group check when search
    slot points to slot beyong leaf
  btrfs-progs: fsck-test: Add test image for lowmem mode block group
    false alert
  btrfs-progs: fsck: Output verbose error when fsck found a bug
  btrfs-progs: lowmem check: Fix false alert in checking data extent
    pointing to prealloc extent
  btrfs-progs: lowmem check: Fix extent item size false alert
  btrfs-progs: tests: Move fsck-tests/015 to fuzz tests
  btrfs-progs: fsck-tests: Make 013 compatible with lowmem mode
  btrfs-progs: fsck-tests: Add new test case for partly written prealloc
    extent

 cmds-check.c                                       |  80 ++++++++++++++++-----
 tests/common                                       |   8 +--
 tests/common.local                                 |   2 +-
 tests/fsck-tests/013-extent-tree-rebuild/test.sh   |   2 +-
 .../block_group_item_false_alert.raw.xz            | Bin 0 -> 47792 bytes
 tests/fsck-tests/020-extent-ref-cases/test.sh      |  30 ++++++--
 .../images}/bko-97171-btrfs-image.raw.txt          |   0
 .../images}/bko-97171-btrfs-image.raw.xz           | Bin
 8 files changed, 95 insertions(+), 27 deletions(-)
 create mode 100644 tests/fsck-tests/020-extent-ref-cases/block_group_item_false_alert.raw.xz
 rename tests/{fsck-tests/015-check-bad-memory-access => fuzz-tests/images}/bko-97171-btrfs-image.raw.txt (100%)
 rename tests/{fsck-tests/015-check-bad-memory-access => fuzz-tests/images}/bko-97171-btrfs-image.raw.xz (100%)

-- 
2.11.0




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2017-02-06  1:25 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-23  9:13 [PATCH 0/9] Lowmem mode fsck fixes with fsck-tests framework update Qu Wenruo
2017-01-23  9:13 ` [PATCH 1/9] btrfs-progs: lowmem check: Fix wrong block group check when search slot points to slot beyong leaf Qu Wenruo
2017-01-23  9:13 ` [PATCH 2/9] btrfs-progs: fsck-test: Add test image for lowmem mode block group false alert Qu Wenruo
2017-01-23  9:13 ` [PATCH 3/9] btrfs-progs: fsck: Output verbose error when fsck found a bug Qu Wenruo
2017-01-23  9:13 ` [PATCH 4/9] btrfs-progs: lowmem check: Fix false alert in checking data extent pointing to prealloc extent Qu Wenruo
2017-01-23  9:13 ` [PATCH 5/9] btrfs-progs: lowmem check: Fix extent item size false alert Qu Wenruo
2017-01-23  9:13 ` [PATCH 6/9] btrfs-progs: tests: Move fsck-tests/015 to fuzz tests Qu Wenruo
2017-01-23  9:13 ` [PATCH 7/9] btrfs-progs: fsck-tests: Make 013 compatible with lowmem mode Qu Wenruo
2017-01-23  9:13 ` [PATCH 8/8] btrfs-progs: fsck: Fix lowmem mode override to allow it skip repair work Qu Wenruo
2017-01-23  9:13 ` [PATCH 8/9] btrfs-progs: fsck-tests: Add new test case for partly written prealloc extent Qu Wenruo
2017-01-23  9:13 ` [PATCH 9/9] btrfs-progs: fsck: Fix lowmem mode override to allow it skip repair work Qu Wenruo
2017-01-24 16:54 ` [PATCH 0/9] Lowmem mode fsck fixes with fsck-tests framework update Christoph Anton Mitterer
2017-01-25  0:44   ` Qu Wenruo
2017-01-25  0:46     ` Christoph Anton Mitterer
2017-01-25  4:16       ` Qu Wenruo
2017-01-25  4:40         ` Christoph Anton Mitterer
2017-01-26  2:50         ` Christoph Anton Mitterer
2017-01-26  3:10           ` Qu Wenruo
2017-01-26  3:30             ` Christoph Anton Mitterer
2017-01-26 23:31             ` Christoph Anton Mitterer
2017-01-29  4:27               ` Qu Wenruo
2017-01-30  3:07                 ` Christoph Anton Mitterer
2017-02-01  1:06                   ` Qu Wenruo
2017-02-01 22:03                     ` Christoph Anton Mitterer
2017-02-02  0:25                       ` Qu Wenruo
2017-02-02  2:12                         ` Qu Wenruo
     [not found]                           ` <1486098502.7443.3.camel@lmu.de>
2017-02-03  6:20                             ` Qu Wenruo
2017-02-03 23:01                               ` Christoph Anton Mitterer
2017-02-06  1:25                                 ` Qu Wenruo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.