From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Subject: [RFC PATCH 0/2] Btrfs partial csum support
Date: Fri, 10 Jul 2015 12:09:01 +0800 [thread overview]
Message-ID: <1436501343-2605-1-git-send-email-quwenruo@cn.fujitsu.com> (raw)
This patchset will add partial csum support for btrfs.
Partial csum will take full advantage of the 32 bytes csum space inside
the tree block, while still maintain backward compatibility on old
kernels.
The overall idea is like the following on 16K leaf:
[Old tree block csum]
0 4 8 12 16 20 24 28 32
-------------------------------------------------
|csum | unused, all 0 |
-------------------------------------------------
Csum is the crc32 of the whole tree block data.
[New tree block csum]
-------------------------------------------------
|csum0|csum1|csum2|csum3|csum4|csum5|csum6|csum7|
-------------------------------------------------
Where csum0 is the same as the old one, crc32 of the whole tree block
data.
And csum1~csum7 will restore crc32 of each eighth part.
Take example of 16K leafsize, then:
csum1: crc32 of BTRFS_CSUM_SIZE~4K
csum2: crc32 of 4K~6K
...
csum7: crc32 of 14K~16K
When nodesize is small, like 4K, partial csum is completely useless.
But when nodesize grows up, like 32K, each partial csum will just covers
a page, making scrub able to judge which page is OK even without reading
out the whole tree block.
And add the possibility to fix case like corruption happens at all
mirror but in different part.
Such case should be more possible if nodesize goes up beyond 16K.
Qu Wenruo (1):
btrfs: csum: Introduce partial csum for tree block.
Zhao Lei (1):
btrfs: scrub: Add support partial csum
fs/btrfs/disk-io.c | 74 ++++++++++++-------
fs/btrfs/scrub.c | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 255 insertions(+), 26 deletions(-)
--
2.4.5
next reply other threads:[~2015-07-10 4:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-10 4:09 Qu Wenruo [this message]
2015-07-10 4:09 ` [RFC PATCH 1/2] btrfs: csum: Introduce partial csum for tree block Qu Wenruo
2015-07-10 4:09 ` [RFC PATCH 2/2] btrfs: scrub: Add support partial csum Qu Wenruo
2015-07-20 8:12 ` [RFC PATCH 0/2] Btrfs partial csum support Qu Wenruo
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=1436501343-2605-1-git-send-email-quwenruo@cn.fujitsu.com \
--to=quwenruo@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/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).