[thin_check] rename --fix-metadata-leaks to --auto-repair
This flag will cover all trivial fixes, such as data leaks.
This commit is contained in:
parent
ebcfc322c0
commit
2860b4c0b1
@ -30,7 +30,7 @@ Options:
|
|||||||
{-h|--help}
|
{-h|--help}
|
||||||
{-V|--version}
|
{-V|--version}
|
||||||
{-m|--metadata-snap}
|
{-m|--metadata-snap}
|
||||||
{--fix-metadata-leaks}
|
{--auto-repair}
|
||||||
{--override-mapping-root}
|
{--override-mapping-root}
|
||||||
{--clear-needs-check-flag}
|
{--clear-needs-check-flag}
|
||||||
{--ignore-non-fatal-errors}
|
{--ignore-non-fatal-errors}
|
||||||
|
@ -95,14 +95,14 @@
|
|||||||
"Unrecognised option should cause failure"
|
"Unrecognised option should cause failure"
|
||||||
(run-fail (thin-check "--hedgehogs-only")))
|
(run-fail (thin-check "--hedgehogs-only")))
|
||||||
|
|
||||||
(define-scenario (thin-check incompatible-options fix-metadata-leaks)
|
(define-scenario (thin-check incompatible-options auto-repair)
|
||||||
"Incompatible options should cause failure"
|
"Incompatible options should cause failure"
|
||||||
(with-valid-metadata (md)
|
(with-valid-metadata (md)
|
||||||
(run-fail (thin-check "--fix-metadata-leaks" "-m" md))
|
(run-fail (thin-check "--auto-repair" "-m" md))
|
||||||
(run-fail (thin-check "--fix-metadata-leaks" "--override-mapping-root 123" md))
|
(run-fail (thin-check "--auto-repair" "--override-mapping-root 123" md))
|
||||||
(run-fail (thin-check "--fix-metadata-leaks" "--super-block-only" md))
|
(run-fail (thin-check "--auto-repair" "--super-block-only" md))
|
||||||
(run-fail (thin-check "--fix-metadata-leaks" "--skip-mappings" md))
|
(run-fail (thin-check "--auto-repair" "--skip-mappings" md))
|
||||||
(run-fail (thin-check "--fix-metadata-leaks" "--ignore-non-fatal-errors" md))))
|
(run-fail (thin-check "--auto-repair" "--ignore-non-fatal-errors" md))))
|
||||||
|
|
||||||
(define-scenario (thin-check incompatible-options clear-needs-check-flag)
|
(define-scenario (thin-check incompatible-options clear-needs-check-flag)
|
||||||
"Incompatible options should cause failure"
|
"Incompatible options should cause failure"
|
||||||
@ -145,10 +145,10 @@
|
|||||||
(with-valid-metadata (md)
|
(with-valid-metadata (md)
|
||||||
(run-ok (thin-check "--clear-needs-check-flag" md))))
|
(run-ok (thin-check "--clear-needs-check-flag" md))))
|
||||||
|
|
||||||
(define-scenario (thin-check fix-metadata-leaks)
|
(define-scenario (thin-check auto-repair)
|
||||||
"Accepts --fix-metadata-leaks"
|
"Accepts --auto-repair"
|
||||||
(with-valid-metadata (md)
|
(with-valid-metadata (md)
|
||||||
(run-ok (thin-check "--fix-metadata-leaks" md))))
|
(run-ok (thin-check "--auto-repair" md))))
|
||||||
|
|
||||||
(define-scenario (thin-check tiny-metadata)
|
(define-scenario (thin-check tiny-metadata)
|
||||||
"Prints helpful message in case tiny metadata given"
|
"Prints helpful message in case tiny metadata given"
|
||||||
|
@ -40,6 +40,10 @@ OPTIONS
|
|||||||
The snap does not contain space maps, so these will not be checked. This
|
The snap does not contain space maps, so these will not be checked. This
|
||||||
may be used on live metadata.
|
may be used on live metadata.
|
||||||
|
|
||||||
|
--auto-repair Automatically repair any trivial issues found with the metadata.
|
||||||
|
|
||||||
|
Currently only fixes metadata leaks.
|
||||||
|
|
||||||
--override-mapping-root <block> Specify a mapping root to use.
|
--override-mapping-root <block> Specify a mapping root to use.
|
||||||
|
|
||||||
Don't use this. This overrides what's specified in the superblock. Only
|
Don't use this. This overrides what's specified in the superblock. Only
|
||||||
|
@ -92,7 +92,7 @@ thin_check_cmd::usage(std::ostream &out) const
|
|||||||
<< " {-h|--help}\n"
|
<< " {-h|--help}\n"
|
||||||
<< " {-V|--version}\n"
|
<< " {-V|--version}\n"
|
||||||
<< " {-m|--metadata-snap}\n"
|
<< " {-m|--metadata-snap}\n"
|
||||||
<< " {--fix-metadata-leaks}\n"
|
<< " {--auto-repair}\n"
|
||||||
<< " {--override-mapping-root}\n"
|
<< " {--override-mapping-root}\n"
|
||||||
<< " {--clear-needs-check-flag}\n"
|
<< " {--clear-needs-check-flag}\n"
|
||||||
<< " {--ignore-non-fatal-errors}\n"
|
<< " {--ignore-non-fatal-errors}\n"
|
||||||
@ -117,7 +117,7 @@ thin_check_cmd::run(int argc, char **argv)
|
|||||||
{ "ignore-non-fatal-errors", no_argument, NULL, 3},
|
{ "ignore-non-fatal-errors", no_argument, NULL, 3},
|
||||||
{ "clear-needs-check-flag", no_argument, NULL, 4 },
|
{ "clear-needs-check-flag", no_argument, NULL, 4 },
|
||||||
{ "override-mapping-root", required_argument, NULL, 5},
|
{ "override-mapping-root", required_argument, NULL, 5},
|
||||||
{ "fix-metadata-leaks", no_argument, NULL, 6},
|
{ "auto-repair", no_argument, NULL, 6},
|
||||||
{ NULL, no_argument, NULL, 0 }
|
{ NULL, no_argument, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ thin_check_cmd::run(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
// fix-metadata-leaks
|
// auto-repair
|
||||||
fs.check_opts.set_fix_metadata_leaks();
|
fs.check_opts.set_fix_metadata_leaks();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user