Commit Graph

1814 Commits

Author SHA1 Message Date
Joe Thornber
3cf0dba469 [cache_dump] fix how needs_check flag is checked 2021-03-03 09:47:42 +00:00
Ming-Hung Tsai
eb3d181f95 [cache_dump (rust)] First draft of cache_dump 2021-03-03 12:27:51 +08:00
Ming-Hung Tsai
fde0e0e2b8 [cache (rust)] Add Mapping::is_dirty() 2021-03-03 12:14:46 +08:00
Ming-Hung Tsai
74fcb9d505 [cache (rust)] Fix data types 2021-02-26 23:31:12 +08:00
Joe Thornber
3d9b32e509 Merge branch 'main' of github.com:jthornber/thin-provisioning-tools into main 2021-02-26 15:26:33 +00:00
Joe Thornber
d4299a00d0 Make pack_node() and calc_max_entries() public for dm-unit 2021-02-26 15:25:53 +00:00
Joe Thornber
441a000c52
Merge pull request #163 from mingnus/rust-cache-tools
[cache (rust)] Fix merge conflicts
2021-02-24 12:33:50 +00:00
Ming-Hung Tsai
a7ecfba2b4 [cache (rust)] Fix merge conflicts 2021-02-24 20:21:10 +08:00
Joe Thornber
a4ba01cacd
Merge pull request #160 from mingnus/rust-cache-tools
First draft of cache_check in Rust
2021-02-24 09:53:51 +00:00
Ming-Hung Tsai
2bb3bf65b7 [cache_check (rust)] Implement basic functions 2021-02-24 17:39:11 +08:00
Joe Thornber
78c93ce09b
Merge pull request #162 from mingnus/main-thin-debug
[dbg] Enhance debugging tools
2021-02-22 08:28:07 +00:00
Ming-Hung Tsai
e8410dec04 [dbg] Add missing commands to cache/era_debug 2021-02-21 19:16:51 +08:00
Ming-Hung Tsai
29f9182078 [dbg] Remove nested function template to reduce code size 2021-02-21 01:07:55 +08:00
Ming-Hung Tsai
a81cef4467 [dbg] Pull out common code into dbg-lib
- Modularize common routines
- Extract the block_dumper interface for displaying blocks
- Remove inheritance from show_traits
2021-02-21 01:04:35 +08:00
Ming-Hung Tsai
c95e31bef6 [era_debug] Display bitset entries in run-length fashion 2021-02-21 00:02:57 +08:00
Ming-Hung Tsai
afbd913e22 [era] Add era_debug 2021-02-18 23:40:39 +08:00
Ming-Hung Tsai
1bc88bfde8 [cache_debug] Simplify the trait types 2021-02-18 18:20:48 +08:00
Ming-Hung Tsai
e3a646e4d2 [dbg] Improve error resilience of debugging tools
Do not open the metadata. The tool interprets user specified blocks one-by-one.
Thus, there's no need to preload the metadata structures.

Also remove the unused --ignore-metadata-space-map option. It was designed
to control the loading of space maps with the old metadata constructors.
2021-02-18 00:00:55 +08:00
Joe Thornber
58cd881340 Fix regression where era_restore wouldn't work with devices.
check_file_exists() had an extra parameter added with a default, which was
the wrong default for era_restore.
2021-02-17 15:15:57 +00:00
Joe Thornber
763b2d14b2 [io_engine] Add Block::zeroed() constructor 2021-02-09 14:34:26 +00:00
Joe Thornber
c3c6d37aea Fix a lot of clippy warnings 2021-02-08 10:38:21 +00:00
Joe Thornber
e62fa3e835 Merge branch 'main' of github.com:jthornber/thin-provisioning-tools into main 2021-02-04 10:01:17 +00:00
Joe Thornber
6f30d17f04 version.rs includes VERSION directly.
So you no longer need to run ./configure to build the rust tools
2021-02-04 10:00:32 +00:00
Joe Thornber
8dbbe7fe27
Merge pull request #161 from mingnus/main-thin-debug
[dbg] Integrate thin_debug, and add cache_debug
2021-02-04 10:00:09 +00:00
Ming-Hung Tsai
08bd2f47bd [cache_debug] Fork thin_debug into cache_debug 2021-02-04 14:29:18 +08:00
Ming-Hung Tsai
a05ac553b6 [dbg] Hide implementations of shared components 2021-02-04 14:28:17 +08:00
Ming-Hung Tsai
b9b04dc872 [thin_debug] Factor out reusable componments 2021-02-04 14:19:28 +08:00
Ming-Hung Tsai
e046bbf5c4 [thin_debug] Simplify the output format
Turn nested fields into attributes. Also replace spaces in field names
by underscores.
2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
0816430ba0 [thin_debug] Remove the using boost directive to avoid namespace pollution
boost::uint32_t might conflict with the toolchain defined uint32_t.
which causes template argument deduction failed.
2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
ab3b2cbda2 [thin_debug] Refine the outputs
- Show the blocknr from node header
- Display the index of node entries
2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
6dc5086643 [thin_debug] Add commands to show space maps 2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
3bfa775887 [thin_debug] Show space map roots in superblock 2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
127f44c66b [thin_debug] Enhance error handling
- Handle exception thrown by commands
- Add help and exit commands
2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
62d09c6752 [thin_debug] Reduce code size by eliminating duplicated types
This patch doesn't have a significant effect - only a few KBs of code
is reduced. However, it's still a nice have.
2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
0ce026caf5 [thin_debug] Integrate thin_debug into the main program 2021-02-03 15:51:52 +08:00
Ming-Hung Tsai
faa371c208 [cache (rust)] Implement cache primitives 2021-02-03 15:18:47 +08:00
Ming-Hung Tsai
087a4711a5 [array (rust)] Implement array basis 2021-02-03 15:18:41 +08:00
Joe Thornber
9733ceb949
Merge pull request #158 from mingnus/main
[cache_writeback] Support offset within the source and destination devices
2021-01-20 11:06:21 +00:00
Ming-Hung Tsai
4c17076f09 [cache_writeback] Support offset within the source and destination devices 2021-01-20 12:02:13 +08:00
Joe Thornber
76ac202463
Merge pull request #157 from mingnus/main
[build] Enable building the dev-tools for functional tests
2021-01-12 09:02:43 +00:00
Ming-Hung Tsai
6a2fa73924 [build] Enable building the dev-tools for functional tests
- Factor out the dev-tools into a stand-alone, no-installed program
- Built the dev-tools if --enable-testing is specified
- Remove the --enable-dev-tools configure option
- Allow suffix on the binary name
- Update symlinks
- Cleanup Makefile
2021-01-12 16:08:51 +08:00
Ming-Hung Tsai
8d59a83f7c [functional-tests] Update thin_delta help text 2021-01-12 02:50:46 +08:00
Ming-Hung Tsai
ca7e79a828 Merge commit 'b67b587' into main 2021-01-12 02:50:12 +08:00
Joe Thornber
443b3c8f0b [io_engine (rust)] get_nr_blocks() wasn't handling block devices.
Now calls file_utils::file_size()
2020-12-02 15:20:14 +00:00
Joe Thornber
ba7fd7bd2b [thin_check (rust)] Make --sync-io the default.
For some systems you have to adjust the ulimits to get io_uring
to work, so we now default to using sync io.

Also added --async-io flag.
2020-12-02 11:33:05 +00:00
Joe Thornber
0e4622f337 [Rust tools] squash lots of warnings 2020-12-01 11:50:32 +00:00
Joe Thornber
327fc80fb0 Merge branch 'main' into 2020-10-09-thin-restore-rewrite 2020-11-25 11:20:28 +00:00
Joe Thornber
83eea11d12
Merge pull request #155 from mingnus/thin-check-fix-metadata-leaks
thin_check fixes
2020-11-24 10:30:35 +00:00
Ming-Hung Tsai
565c656ed2 [thin_generate_damage] Do not open a new transaction to prevent ref-count underflow
There's a chance that thin_generate_damage tries to change ref-counts of
space map blocks due to its random nature, which could lead to problems.
If the ref-counts of metadata space map blocks (shadow source) is changed
to zero, then the ref-counts will become underflow after a shadow operation.

In-place space map modification is a way to prevent that value underflow.
An alternative approach is to avoid changing ref-counts of space map blocks.
2020-11-24 18:18:21 +08:00
Ming-Hung Tsai
c932a76f08 [unit-tests] Add underfull nodes counting tests 2020-11-24 18:18:21 +08:00