From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: osandov@osandov.com, Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 0/6] Freespace tree repair support
Date: Fri, 15 Jun 2018 14:05:56 +0300 [thread overview]
Message-ID: <1529060762-4372-1-git-send-email-nborisov@suse.com> (raw)
Hello,
This patchset adds support to btrfs check to repair corrupted freespace tree.
Once this has been merged then we can start thinking of making the freespace
tree the default freespace cache and deprecate the existing v1 cache in new
filesystems.
This series depend on the already sent delayed refs. In order to facilitate
testing the 2 series have been integrated and posted at :
https://github.com/lorddoskias/btrfs-progs.git dev/delayed-refs-fst
The main thing with this code is that the repair will always regenerate the
FST with extents since it I haven't ported the code which deals with
detecting that bitmaps are more space efficient. This is not a big deal since
the kernel will do it.
The first patch is here for completeness' sake and was only used in a previous
incarnation of this code but since I've re-worked the way the code is supposed
to work it can be dropped. I don't have strong opinions either way. It just
teaches btrfs_read_fs_root to return the freespace root
Patch 2 adds some low-level bit manipulation primitives which are necessary to
support bitmap based FST. My initial idea was to completely ommit the bitmap
support but in testing it turned out to be less pain to just include it from
the get-go. Otherwise the filesystem created in the test case in patch 6
couldn't be worked on.
Patch 3 is mostly copy/paste from the kernel code bringin in necessary
functions to repair the freespace tree. I've only omitted locking code since
in userspace we are always single-threaded, also there is no support currently
when regenerating FST to convert it to bitmap.
Patch 4 updates the compat_ro bitmask to allow reading an FST filesystem in
repair mode.
Patch 5 adds the core code which utilizes everything added up until this point.
It's not that big and should be fairly easy to review.
Patch 6 is a test-case which creates a filesystem with FST enabled, populates it
with some files and then corrupts a bitmap and an extent records and tries to
repair them. It's passing for me.
Nikolay Borisov (6):
btrfs-progs: Add support for freespace tree in btrfs_read_fs_root
btrfs-progs: Add extent buffer bitmap manipulation infrastructure
btrfs-progs: Pull free space tree related code from kernel
btrfs-progs: Add freespace tree as compat_ro supported feature
btrfs-progs: check: Add support for freespace tree fixing
btrfs-progs: tests: Test for FST corruption detection/repair
check/main.c | 61 +-
ctree.c | 77 ++
ctree.h | 8 +-
disk-io.c | 3 +
extent-tree.c | 9 +
extent_io.c | 39 +
extent_io.h | 15 +
free-space-tree.c | 893 +++++++++++++++++++++-
free-space-tree.h | 10 +-
tests/fsck-tests/035-freespacetree-repair/test.sh | 79 ++
10 files changed, 1163 insertions(+), 31 deletions(-)
create mode 100755 tests/fsck-tests/035-freespacetree-repair/test.sh
--
2.7.4
next reply other threads:[~2018-06-15 11:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 11:05 Nikolay Borisov [this message]
2018-06-15 11:05 ` [PATCH 1/6] btrfs-progs: Add support for freespace tree in btrfs_read_fs_root Nikolay Borisov
2018-09-21 19:50 ` Omar Sandoval
2018-06-15 11:05 ` [PATCH 2/6] btrfs-progs: Add extent buffer bitmap manipulation infrastructure Nikolay Borisov
2018-09-21 20:08 ` Omar Sandoval
2018-06-15 11:05 ` [PATCH 3/6] btrfs-progs: Pull free space tree related code from kernel Nikolay Borisov
2018-09-21 20:19 ` Omar Sandoval
2018-09-21 20:38 ` Nikolay Borisov
2018-06-15 11:06 ` [PATCH 4/6] btrfs-progs: Add freespace tree as compat_ro supported feature Nikolay Borisov
2018-09-21 20:39 ` Omar Sandoval
2018-06-15 11:06 ` [PATCH 5/6] btrfs-progs: check: Add support for freespace tree fixing Nikolay Borisov
2018-09-21 20:42 ` Omar Sandoval
2018-06-15 11:06 ` [PATCH 6/6] btrfs-progs: tests: Test for FST corruption detection/repair Nikolay Borisov
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=1529060762-4372-1-git-send-email-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=osandov@osandov.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;
as well as URLs for NNTP newsgroup(s).