git: sbin/hammer: Use last active big-block to limit recovery scan range
tkusumi at crater.dragonflybsd.org
Sat Dec 10 05:49:45 PST 2016
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date: Sat Dec 10 14:41:43 2016 +0900
sbin/hammer: Use last active big-block to limit recovery scan range
This commit is to fix a bug mentioned in f2dd4b0c. This commit
uses offset of the last active big-block (big-block with maximum
zone-2 offset whose layer2->zone is neither 0,4,15), as an upper
limit of scan range, so it doesn't scan beyond actual consumption.
Note that this upper limit is used only if all layer1/2 entries
have correct CRC values. Otherwise the entire image is scanned
as usual (unless quick option is used).
Note that this upper limit doesn't necessarily equal a big-block
before the first unused big-block offset (i.e. layer2->zone == 0),
because reblock could locate unused big-block between used ones.
Note that using the upper limit also tries to avoid recovery of
irrelevant files from old filesystem that could exist beyond the
upper limit (if not perfect). It also speeds up recovery process.
Summary of changes:
sbin/hammer/cmd_recover.c | 103 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 100 insertions(+), 3 deletions(-)
DragonFly BSD source repository
More information about the Commits