Commit Graph

25 Commits

Author SHA1 Message Date
Ming-Hung Tsai
1fe8a0dbde [thin_check] Allow using --clear-needs-check and --skip-mappings together
Although it is not recommended to clear the flag without a full
examination, however, the usage has been documented as an approach
to reduce lvchange run time [1]. For the purpose of backward
compatibility and avoiding boot failure after upgrading thin_check [2],
the limitation is now removed.

[1] https://wiki.archlinux.org/index.php/LVM#Thinly-provisioned_root_volume_device_times_out
[2] Community feedback on previous commit:
    https://github.com/jthornber/thin-provisioning-tools/commit/b278f4f
2020-11-24 18:17:36 +08:00
Ming-Hung Tsai
9f3823c97d [metadata_checker] Rename function to reflect command line changes 2020-08-14 18:49:41 +08:00
Ming-Hung Tsai
6c90f9483e [metadata_checker] Support in-place metadata space map modification 2020-08-12 16:57:16 +08:00
Ming-Hung Tsai
b278f4ffa4 [thin_check] Change the policy of --clear-needs-check-flag to prevent error recurrence
- Disallow clearing the needs_check flag if there's any error,
  i.e., the metadata must be fully examined, and the result must
  be NO_ERROR.
- Disallow combining --clear-needs-check with -m, --super-blocks-only,
  --skip-mappings, --override-mapping-root, or --ignore-non-fatal-errors.
2020-07-30 23:00:50 +08:00
Ming-Hung Tsai
49efa06ffa [thin_check] Support fixing leaked metadata blocks
- The leaked blocks are defined as allocated but not used ones,
  i.e., expected ref-count == 0 and actual ref-count <= 2.
- Blocks with expected ref-count > 0, or actual ref-count > 2,
  are treated as unrepairable leaks.
- The fixing processing won't be executed if there's any
  unrepairable leak or errors.
- The fixing process implicitly clearing the superblock
  needs_check flag if there's no error.
2020-07-30 23:00:50 +08:00
Ming-Hung Tsai
7be6b91420 [metadata_checker] Tidying: rename variables 2020-07-29 16:47:22 +08:00
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
86704deacb [thin_check] Add support for --metadata-snap.
Not tested yet.
2020-06-09 14:25:19 +01:00
Joe Thornber
16a10d2554 [thin_check] Remove the metadata_checker base class.
It's really only a single method.
2020-05-28 14:43:03 +01:00
Joe Thornber
c94f560be8 [thin_check] Check the ref counts in the data space map.
Hadn't realised this was being done.
2020-05-28 14:35:51 +01:00
Joe Thornber
4313469475 [all] Switch from boost::shared_ptr -> std::shared_ptr.
Shared_ptr has moved into the standard library since these tools were
first written.
2020-04-30 15:02:43 +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
Ming-Hung Tsai
c85ea5ef76 [thin_check] factor out metadata_checker 2020-02-17 11:42:24 +00:00
Joe Thornber
e64dda95f6 rename range<> -> run<> 2013-05-28 12:20:05 +01:00
Joe Thornber
83d6b609eb [range.h] rename to run.h 2013-05-28 11:51:44 +01:00
Joe Thornber
553f73b826 superblock_checker.* -> superblock.*, remove metadata_disk_structures.* and rearrange namespaces a bit. 2013-05-21 12:46:07 +01:00
Joe Thornber
a7adefbae8 Move range.h to persistent-data 2013-05-08 16:38:04 +01:00
Joe Thornber
5e26d51372 add equality operators for the metadata_damage classes. 2013-04-29 16:12:05 +01:00
Joe Thornber
969a5f62c6 Working on device_checker 2013-04-29 15:37:53 +01:00
Joe Thornber
6422b22610 Move block_manager member down into checker base class. 2013-04-29 13:31:33 +01:00
Joe Thornber
1a8b1b29e8 Start device_checker 2013-04-29 13:24:19 +01:00
Joe Thornber
2b8b74065b add fixme 2013-04-29 12:40:56 +01:00
Joe Thornber
a55f6fcf78 A stack of thin_check refactorings 2013-04-25 16:27:07 +01:00
Joe Thornber
20ff78c818 [thin_check] Start refactoring metadata_checker. 2013-04-23 15:21:44 +01:00
Joe Thornber
282e98a6b1 Move source into separate sub directories. 2013-01-02 12:55:41 +00:00