Commit Graph

2028 Commits

Author SHA1 Message Date
pepe
77d2feb230 :) 2023-05-13 00:20:51 +00:00
Ming-Hung Tsai
8806dfe4f4 [cache_writeback] Fix space map commits
Fix github issue #138
2022-01-10 23:31:10 +08:00
Joe Thornber
8f9f9c74f6
Merge pull request #193 from arrikto/feature-fix-era-invalidate
[era_invalidate] Don't read the live metadata when the --metadata-snapshot option is provided
2022-01-05 11:45:08 +00:00
Nikos Tsironis
9f30793355 [era_invalidate] Don't read the live metadata when the --metadata-snapshot option is provided
Until now, 'era_invalidate' read the live metadata (superblock), instead
of the metadata snapshot, when using the --metadata-snapshot parameter.

Fix this by passing the location of the metadata snapshot to
'open_metadata()', when a metadata snapshot is used.

Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com>
2022-01-05 12:30:02 +02:00
Joe Thornber
cab57534c6
Merge pull request #191 from mingnus/2021-10-20-era-tools-rebase
era-tools in Rust
2021-11-01 09:51:59 +00:00
Ming-Hung Tsai
f3c2ade90a [thin_ll_dump] Fix potential segfault while reading invalid subtree roots 2021-10-21 21:58:09 +08:00
Ming-Hung Tsai
e5f0acd288 [thin_metadata_size (rust)] First code drop 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
9ea75ba113 [tests] Move cache_metadata_size tests to Rust
Changes for the Rust version in corresponding to command line changes:
- Disable tests 'all_args_agree' and 'conradictory_info_fails'
- Test conflicts between --nr-blocks and {--device-size|--block-size}
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
cc89cef43f [era_dump (rust)] Dump the current_writeset that has not been archived
This patch is added in corresponding to the dm-era patch de89afc1 in kernel:
dm era: Recover committed writeset after crash
2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
533e174051 [era_dump (rust)] Support wrapped-around era in logical dump 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
89e568b897 [era_dump (rust)] Implement logical dump 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
cbc3baba45 [tests] Move era_dump tests to Rust 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
f6eb5173c9 [era_restore] Avoid touching the output file by checking input file earlier
The output file has been checked by the caller, so there's no need
to check the output file again.
2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
8d3f65244d [tests] Move era_restore tests to Rust 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
4cfe93570c [tests] Add era test fixtures 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
321fce882f [tests] Move era_check tests to Rust 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
0215b5fecd [era_check (rust)] Remove unused option 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
8fa7f96dfd [era_dump/restore (rust)] Support displaying writeset blocks in ranges
- Group adjacent marked blocks into ranges
- Show marked blocks only, and ignore untouched blocks
2021-10-21 17:49:36 +08:00
Ming-Hung Tsai
4559039066 [era_invalidate (rust)] First code drop 2021-10-21 17:04:54 +08:00
Ming-Hung Tsai
0791208ca4 [io_engine (rust)] Open file exclusively 2021-10-21 16:18:14 +08:00
Ming-Hung Tsai
9ab4172790 [cache_restore (rust)] Tidy up 2021-10-21 16:18:14 +08:00
Ming-Hung Tsai
36767bcda6 [era_repair (rust)] First code drop 2021-10-21 16:18:14 +08:00
Ming-Hung Tsai
3a8dc8da2d [xml (rust)] Log invalid attribute name 2021-10-21 16:18:14 +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
8a1399e3bb [cache_dump (rust)] Make use of the --repair option
Ignore non-fatal errors, and regenerate unavailable dirty bits if --repair was applied.
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
Ming-Hung Tsai
13aeefcdeb [thin] Fix typo 2021-10-20 20:23:27 +08:00
Joe Thornber
959b04ecb5 [thin_dump] fix overrides 2021-10-20 13:06:15 +01:00
Joe Thornber
56ea130650 [tests/thin_dump] Update help string 2021-10-19 15:24:16 +01:00
Joe Thornber
a568da8c71 [tests/thin_dump] remove some extraneous output to stderr 2021-10-19 15:23:17 +01:00
Joe Thornber
c5645d798f [tests/thin_delta] fix bad_option check 2021-10-19 14:25:56 +01:00
Joe Thornber
44d29b0467 [tests/thin_check] Clean up test dir 2021-10-19 14:25:25 +01:00
Joe Thornber
98be38dc4c [tests] Improve stdout/stderr logging when running sub processes 2021-10-19 14:20:47 +01:00
Joe Thornber
13400c2465 [tests/thin_delta] thin_delta should be a c++ command 2021-10-19 14:11:56 +01:00
Joe Thornber
6c5405ccf8 [tests] Get the run_* functions to log what they're doing. 2021-10-18 16:59:17 +01:00
Joe Thornber
024554c987 Merge rust tools into a single pdata_tools exe 2021-10-11 12:07:26 +01:00
Joe Thornber
c9b47437f2
Merge pull request #189 from mingnus/2021-08-30-functional-tests
Functional tests and misc fixes
2021-09-30 15:15:21 +01:00
Ming-Hung Tsai
d712190db4 [io_engine (rust)] Open file exclusively 2021-09-22 17:07:56 +08:00
Ming-Hung Tsai
6bd7741dfa [cache_repair] Avoid touching the output file by checking input file earlier
The output file has been checked by the caller, so there's no need
to check the output file again.
2021-09-22 17:07:56 +08:00
Ming-Hung Tsai
5abb92838c [tests] Port the remaining cache tests 2021-09-22 17:07:56 +08: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
c133e62353 [thin_dump] Emit superblock flags 2021-09-22 17:05:59 +08:00
Ming-Hung Tsai
34f927d989 [thin_check (rust)] Make better use of Rust's Result type
Replace the bail_out checking with the returned Result, which helps
decoupling the internal state of Report from application logic.
2021-09-22 17:05:59 +08:00
Ming-Hung Tsai
438730951e [thin_check (rust)] Allow ignoring non-fatal errors in mapping tree 2021-09-22 17:05:59 +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
e7fa012701 [btree] Fix ref-counting on overwritten values 2021-09-22 17:05:59 +08:00