Commit Graph

39 Commits

Author SHA1 Message Date
Joe Thornber
fec11289b0 [thin_check/dump] Under populated nodes are now 'non fatal errors'
thin_dump always ignores non-fatal-errors.
2020-07-02 16:03:23 +01:00
Joe Thornber
a407c831df [thin_repair] Fix segfault with metadata containing loops (bz1853241)
'seen' bit was being set too late.
2020-07-02 10:51:10 +01:00
Joe Thornber
e801cc607b [block_manager] Hard code block size to 4k.
We're never going to use anything other than 4k, and by hard coding it we
avoid making block_manager a template.
2020-04-30 14:30:01 +01:00
Arusekk
3ed3925370 Fix compilation with uClibc
Closes #12
2020-03-25 15:58:02 +01:00
Joe Thornber
5f2c3bed69 Add some ftests, and fixup whitespace from Nikhil's work 2019-10-28 11:52:21 +00:00
Nikhil Kshirsagar
91b4714e38 Corrupt superblock repair 2019-10-25 15:02:56 +05:30
Joe Thornber
733c7df798 [thin_repair/thin_dump] Fix some more spurious error messages when doing repair.
Repair was falling back to non-repair behaviour if it thought the roots
were ok.  Now if --repair is specified the same dumping code is always
executed.
2019-06-03 14:03:24 +01:00
Joe Thornber
e45a211902 [thin/metadata_dumper] Change a couple of confusing class names.
metadata_emitter is actually a visitor that passes on it's data
to an encapsulated emitter object.

metadata_emitter -> metadata_emit_visitor
metadata_tree_emitter -> metadata_tree_emit_visitor
2019-06-03 11:07:32 +01:00
Joe Thornber
0624ded67f [thin_repair, thin_dump] Don't look for better roots if the ones in the sb are ok.
Calculating the most recent trees is inexact, so trees other than the ones
in the superblock, which presumably are the most recent, could be chosen.
2019-05-27 16:43:32 +01:00
Joe Thornber
5e6ddbf2da [thin_dump, thin_repair] Fix bad metadata_damage exception
The first pass of the repair process scans all metadata working out the
largest orphan btrees.  This scan doesn't use as much validation as
the btree_walk function which subsequently gets called.

This patch catches any exceptions thrown by the btree walk function
and removes that btree from consideration.
2019-05-27 16:06:59 +01:00
Joe Thornber
65264911c1 [thin_repair, thin_dump] --repair falg wasn't being passed through properly.
Recent regression.
2019-05-27 09:04:55 +01:00
Joe Thornber
595ddfc50f [thin_repair/thin_dump] repair flag wasn't being set internally.
Introduced by recent changes
2019-05-03 15:15:01 +01:00
Joe Thornber
9e20465fd1 [thin-repair, thin_dump] When repairing we now hunt for the best btree roots.
We've had a trickle of users who accidentally activate the same pool on a
VM and host at the same time.  Typically the host doesn't do any IO, but
the kernel will still rewrite the superblock on shutdown.  This leaves
the superblock pointing to very out of date btree roots and so we get
massive metadata loss.

This patch changes thin_repair, and thin_dump --repair.  They now hunt
for the most recent, undamaged and consistent roots of the device and
mapping trees, and use that as the starting point of the repair.
2019-04-17 12:17:13 +01:00
Joe Thornber
aace49cdd6 [thin_repair] work in progress 2019-03-29 12:56:31 +00:00
Ming-Hung Tsai
e8f1bda1a5 [thin] store the device id in single_mapping_tree_damage_visitor for error reporting
1. fix the damage type for single_mapping_tree_damage_visitor
2. walk_mapping_tree() now requires the device id
3. update metadata_dumper and thin_ls for the new walk_mapping_tree()
2016-06-20 00:30:25 +08:00
Joe Thornber
4370f048c0 [thin_dump] --skip-mappings 2016-03-22 15:01:37 +00:00
Joe Thornber
a3f4940f1e [thin_dump] --dev-id 2016-03-22 14:46:33 +00:00
Joe Thornber
8b2ec7a3aa Merge branch 'master' into v0.7-devel
Conflicts:
	VERSION
	persistent-data/space-maps/disk.cc
	persistent-data/space-maps/disk.h
2016-03-22 12:04:51 +00:00
Joe Thornber
b0e2d0e6a0 [thin_repair, metadata] Try harder to get the number of data blocks
when opening the metadata.
2016-03-21 17:17:57 +00:00
Ming-Hung Tsai
ced9929ca6 [metadata_dumper] Support dump a bottom-level data mapping tree 2016-02-27 15:20:31 +08:00
Ming-Hung Tsai
7ec47158b5 [emitter] Preserve the flags and version entries in superblock 2016-02-27 15:20:02 +08:00
Joe Thornber
c8c4442b2f [thin_dump] We can't give the number of data blocks with a metadata snap.
No space maps.
2016-02-10 13:34:07 +00:00
Joe Thornber
c93e728ef4 [base] introduce a command type that gets registered with the app 2016-01-08 12:51:52 +00:00
Joe Thornber
a7c96c0e1e [everything] Fix circular shared pointer references.
We had a cycle from transaction_manager <-> space_map, and also from
the ref_counters back up to the tm.

This prevented objects being destroyed when various programs exited.

From now on we'll try and only use a shared ptr if ownership is
implied.  Otherwise a reference will be used (eg, for up pointers).
2014-08-26 11:14:49 +01:00
Joe Thornber
e77e8715b0 Remove ambiguity between boost::uint64_t and ::uint64_t.
This has been causing people problems on uclibc builds.
2014-07-02 08:19:20 +00:00
Joe Thornber
05effffdf9 [thin-provisioning] re-write metadata_dumper.cc 2013-10-16 10:20:43 +01:00
Joe Thornber
500e508c6d fix up some coverity issues 2013-08-15 16:26:17 +01:00
Joe Thornber
77286e0bc7 Take out some 'typename's to support older versions of gcc (Heinz). 2013-08-15 10:35:07 +01:00
Joe Thornber
f2fe3ba2b3 [metadata_dumper] Fix bug where ranges were appearing in all devices for small metadata.
Author: Teng-Feng Yang
2013-07-09 13:28:36 +01:00
Joe Thornber
e701b96642 [thin_dump] bug in last bug fix 2013-06-28 14:24:39 +01:00
Joe Thornber
fe8e1592a9 [thin_dump] Fix regression where mappings for all devices were being listed in every device. 2013-06-28 13:43:28 +01:00
Joe Thornber
eb8d4c6f0b Get tools building with g++ 4.8.1 2013-06-25 13:48:02 +01:00
Joe Thornber
83a09e1a2a [btree] use a block_ref_counter for internal nodes 2013-06-20 14:29:48 +01:00
Joe Thornber
8f2ab2d676 Introduce mapping_tree.h 2013-05-20 17:37:46 +01:00
Joe Thornber
35880f3038 Move device_details_traits into the device_tree_detail namespace. 2013-05-20 16:35:26 +01:00
Joe Thornber
b0d1fa0851 Sanitise btree_detail::node_location 2013-05-15 13:37:30 +01:00
Joe Thornber
a828cde96d [btree] visitor now passed as a reference rather than shared_ptr 2013-05-02 12:31:33 +01:00
Joe Thornber
5d0b23beea Some btree visitor tidying.
Introduce node_location to replace the long list of parameters.  Also
add a depth field to keep track of the depth from root.
2013-05-01 16:16:23 +01:00
Joe Thornber
282e98a6b1 Move source into separate sub directories. 2013-01-02 12:55:41 +00:00