Commit Graph

73 Commits

Author SHA1 Message Date
Ming-Hung Tsai
e5f0acd288 [thin_metadata_size (rust)] First code drop 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
34f6b6fc62 [cache_metadata_size (rust)] First code drop 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
ed7480e96d [era_restore (rust)] First code drop 2021-10-21 16:18:14 +08:00
Ming-Hung Tsai
55a81c0b9f [era_dump (rust)] First code drop 2021-10-21 16:18:14 +08:00
Ming-Hung Tsai
3d36456a36 [era_check (rust)] First code drop 2021-10-21 16:18:14 +08:00
Ming-Hung Tsai
c8a1da1df9 [all] Apply cargo fmt, and fix clippy warnings 2021-10-20 20:23:27 +08:00
Joe Thornber
024554c987 Merge rust tools into a single pdata_tools exe 2021-10-11 12:07:26 +01:00
Ming-Hung Tsai
66c1d629a4 [all (rust)] Keep silent if --quiet was applied 2021-09-22 17:07:56 +08:00
Ming-Hung Tsai
d436f35ed3 [thin_dump/thin_repair/thin_restore (rust)] Fix errors in tests
- Move error messages to stderr
- Fix the transaction_id and data_block_size in test fixture,
  and check the data_block_size in thin_restore.
- Disable the missing_something tests for Rust. The transaction_id
  and nr_data_blocks now could be recovered automatically.
- Limit the use of override options in test cases. Only broken
  superblocks could be overridden, and the provided values
  should be compatible to the original metadata.
- Remove unused option
2021-09-22 17:06:28 +08:00
Ming-Hung Tsai
a18fd60f3f [thin_check (rust)] Fix auto-repair related errors
- Returns error on metadata leaks
- Clear needs_check flag on success
- Check auto-repair write errors
- Fix file open flags, and correct spelling
2021-09-22 17:05:59 +08:00
Ming-Hung Tsai
f8c40a1fda [thin_check (rust)] Set compatibility between options 2021-09-22 17:05:59 +08:00
Ming-Hung Tsai
2f22a8c55d [all (rust)] Fix errors in testing input option
- Fix file mode bits checking
- Return error reason from stat
2021-09-22 17:05:59 +08:00
Ming-Hung Tsai
4ed2348b36 [cache_restore (rust)] Fix errors in tests
- Move error messages to stderr (fixes unwritable_output_file,
  input_file_not_found, and missing_input_option)
- Validate XML structures implicitly (fixes corrupted_input_data)
- Check output file size (fixes tiny_output_file)
- Allow restoring XML without the hints (for creating test fixtures)
- Provide XML error context
- Remove unused option
2021-09-22 17:05:29 +08:00
Ming-Hung Tsai
0acc57d17f [thin_restore (rust)] Fix errors in tests
- Move error messages to stderr (fixes unwritable_output_file,
  input_file_not_found, and missing_input_option)
- Validate XML structures implicitly (fixes corrupted_input_data)
- Check output file size (fixes tiny_output_file)
- Provide XML error context
- Fix mk_valid_input()
2021-09-16 21:55:46 +08:00
Ming-Hung Tsai
8a822cebec [thin_repair/thin_dump (rust)] Support rebuilding superblock 2021-08-27 02:17:57 +08:00
Ming-Hung Tsai
213442bffd [all (rust)] Fix cosmetic names for argument values 2021-08-27 02:17:57 +08:00
Ming-Hung Tsai
7239204b01 [cache_repair (rust)] First pass at cache_repair 2021-07-27 23:51:20 +08:00
Ming-Hung Tsai
4b9766846e [cache (rust)] Prepare for cache_repair
- Adapt function interfaces for repairing purpose
- Finalize the metadata in the Restorer
- Make the Restorer public
2021-07-27 23:51:20 +08:00
Ming-Hung Tsai
85581cdf5a [thin_repair (rust)] First pass at thin_repair 2021-07-27 23:51:20 +08:00
Ming-Hung Tsai
dccd844714 [thin_restore (rust)] Prepare for thin_repair
- Finalize the metadata in the Restorer
- Make the Restorer public
2021-07-27 23:51:20 +08:00
Ming-Hung Tsai
a50c9d97e2 [thin_metadata_unpack] Fix truncated output file on invalid input
Check the input header before creating or truncating the output file
2021-07-09 01:22:22 +08:00
Ming-Hung Tsai
d00388f68a [thin_shrink] Support short options 2021-07-07 16:06:04 +08:00
Ming-Hung Tsai
1526ab3472 [all] Apply cargo fmt, and fix clippy warning of branches_sharing_code 2021-07-02 16:17:52 +08:00
Kay Lin
c18cd42d35 [build] Update dependencies
- Update crc32c to 0.6, which allows it to be built on AArch64.

  - Update base64 to 0.13
  - Update byteorder to 0.14
  - Update io-uring to 0.4
  - Update libc to 0.2.83
  - Update nix to 0.19
  - Update nom to 6.0.1
  - Update quick-xml to 0.20
  - Update rand to 0.8
  - Update tempfile to 3.2
  - Update tui to 0.14

Signed-off-by: Kay Lin <i@v2bv.net>
2021-06-26 00:08:58 +08:00
Ming-Hung Tsai
2cb84236d4 [all (rust)] Tidy command line options 2021-06-23 14:33:28 +08:00
Ming-Hung Tsai
cd48f00191 [all (rust)] Make sync-io the default
Multithreaded sync-io has performance similar to async-io. Also,
sync-io saves the hassle of setting ulimits to get io_uring working
on some systems (commit ba7fd7b). Now we default to sync-io, and
leave async-io as a hidden option for testing and benchmarking.
2021-06-23 14:33:28 +08:00
Ming-Hung Tsai
fba2adbe56 [tests] Fix minor test errors
- Fix command line arguments
- Adapt error messages for rust implementations
2021-06-21 23:27:51 +08:00
Ming-Hung Tsai
7daff7350a [thin/cache_dump (rust)] Add buffered outputs, and fix command line options 2021-06-21 23:27:51 +08:00
Ming-Hung Tsai
ce94ba73a5 [cache_restore (rust)] First draft 2021-05-28 03:19:42 +08:00
Ming-Hung Tsai
b7bf82b8f2 [all] Fix newline in version string 2021-05-12 12:03:52 +08:00
Ming-Hung Tsai
965fbb6e8f [all] Apply cargo fmt, and fix clippy warnings 2021-05-11 23:53:31 +08:00
Ming-Hung Tsai
5baeab4a5c Merge branch 'main' into rust-cache-tools 2021-05-11 23:16:08 +08:00
Joe Thornber
d9a96758b0
Merge pull request #168 from mingnus/2020-10-09-thin-restore-rewrite
Merge recent changes in thin_restore
2021-05-04 09:21:40 +01:00
Ming-Hung Tsai
43e433149b [all] Apply cargo fmt 2021-05-04 16:10:23 +08:00
Ming-Hung Tsai
cf4b937ade [cache_check (rust)] Check space map counts
- Support space map checking and auto-repair
2021-04-23 16:23:21 +08:00
Ming-Hung Tsai
e1628f9004 [cache_check (rust)] Add more checks
- Check array indices continuity
- Support ignore_non_fatal
- Report blocknr of IoErrors
- Report array block indeices
2021-04-21 23:35:22 +08:00
Ming-Hung Tsai
239ff7dfa1 [cache_check (rust)] Add more checks
- Report errors
- Support reading partially broken bitset
  - The output is a bitmap of 2-bit entries, indicating availability of bits
2021-04-21 14:09:38 +08:00
Ming-Hung Tsai
860b3ca7d2 [cache_check (rust)] Add more checks
- Check the version-1 dirty flag
- Check mappings against the origin device size, if the cache is clean
- Check superblock fields
2021-04-11 20:18:25 +08:00
Joe Thornber
c41b2e8ec3 Some interface changes to let dm-unit use the thin checking code more easily. 2021-04-08 10:45:50 +01:00
Joe Thornber
040e3bfc2d Lot's of work on thin_restore 2021-03-24 14:20:20 +00:00
Ming-Hung Tsai
eb3d181f95 [cache_dump (rust)] First draft of cache_dump 2021-03-03 12:27:51 +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
c3c6d37aea Fix a lot of clippy warnings 2021-02-08 10:38:21 +00:00
Ming-Hung Tsai
ca7e79a828 Merge commit 'b67b587' into main 2021-01-12 02:50:12 +08: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
37ea0280df [thin_restore] first pass at btree_builder.
No tests yet
2020-10-26 12:05:27 +00:00
Joe Thornber
f60ae770c2 [thin_explore] Explore devices tree, including path support. 2020-10-15 11:53:09 +01:00
Joe Thornber
e9fbcc31de [thin_dump (rust)] First pass at thin_dump.
Doesn't include --repair.

This includes <def> and <ref> sections for shared regions.
2020-09-28 15:45:13 +01:00
Joe Thornber
66b6a1ba48 [thin_check (rust)] --superblock-only, --skip-mappings, INFO fields 2020-09-24 13:55:58 +01:00