All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] btrfs-progs: image: Fix error when restoring multi-disk image to single disk
@ 2018-11-27  2:33 Qu Wenruo
  2018-11-27  2:33 ` [PATCH 1/5] btrfs-progs: image: Refactor fixup_devices() to fixup_chunks_and_devices() Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Qu Wenruo @ 2018-11-27  2:33 UTC (permalink / raw)
  To: linux-btrfs

This patchset can be fetched from github:
https://github.com/adam900710/btrfs-progs/tree/image_recover

The base commit is as usual, the latest stable tag, v4.19.


Test case misc/021 will fail if using latest upstream kernel.

This is due to the enhanced code in kernel to check block group <->
chunk <-> dev extent mapping.

This means from the very beginning, btrfs-image can't really restore a
multi-disk image to single-disk one correctly.

The problem is, although we modified chunk item, we didn't modify block
group item's flags or dev extents.

This patch will reset block group flags, then rebuild the whole
dev extents by removing existing ones first, then re-add the correct
dev extents calculated from chunk map.

Now it could pass all misc tests and fsck tests.

Qu Wenruo (5):
  btrfs-progs: image: Refactor fixup_devices() to
    fixup_chunks_and_devices()
  btrfs-progs: image: Fix block group item flags when restoring
    multi-device image to single device
  btrfs-progs: image: Remove all existing dev extents for later rebuild
  btrfs-progs: image: Rebuild dev extents using chunk tree
  btrfs-progs: misc-tests/021: Do extra btrfs check before mounting

 image/main.c                                  | 201 ++++++++++++++++--
 .../021-image-multi-devices/test.sh           |   3 +
 volumes.c                                     |  10 +-
 volumes.h                                     |   4 +
 4 files changed, 197 insertions(+), 21 deletions(-)

-- 
2.19.2


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

end of thread, other threads:[~2018-11-27  7:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27  2:33 [PATCH 0/5] btrfs-progs: image: Fix error when restoring multi-disk image to single disk Qu Wenruo
2018-11-27  2:33 ` [PATCH 1/5] btrfs-progs: image: Refactor fixup_devices() to fixup_chunks_and_devices() Qu Wenruo
2018-11-27  7:13   ` Nikolay Borisov
2018-11-27  7:15     ` Qu Wenruo
2018-11-27  2:33 ` [PATCH 2/5] btrfs-progs: image: Fix block group item flags when restoring multi-device image to single device Qu Wenruo
2018-11-27  7:15   ` Nikolay Borisov
2018-11-27  7:16     ` Qu Wenruo
2018-11-27  2:33 ` [PATCH 3/5] btrfs-progs: image: Remove all existing dev extents for later rebuild Qu Wenruo
2018-11-27  7:26   ` Nikolay Borisov
2018-11-27  2:33 ` [PATCH 4/5] btrfs-progs: image: Rebuild dev extents using chunk tree Qu Wenruo
2018-11-27  7:28   ` Nikolay Borisov
2018-11-27  7:30     ` Qu Wenruo
2018-11-27  7:35       ` Nikolay Borisov
2018-11-27  2:33 ` [PATCH 5/5] btrfs-progs: misc-tests/021: Do extra btrfs check before mounting Qu Wenruo
2018-11-27  7:29   ` Nikolay Borisov
2018-11-27  7:31     ` 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.