[thin_repair, cache_repair] Check input file exists earlier

and zero superblock if we fail part way through a repair.

bz1499781
This commit is contained in:
Joe Thornber
2019-10-08 14:34:24 +01:00
parent a3b8e9db78
commit 1dd7b454bb
6 changed files with 72 additions and 11 deletions

View File

@@ -21,7 +21,7 @@
assert-eof
assert-starts-with
assert-matches
assert-superblock-untouched
assert-superblock-all-zeroes
assert-member?
assert-raises-thunk
assert-raises
@@ -259,7 +259,7 @@
(loop (+ i 1))
#f)))))
(define (assert-superblock-untouched md)
(define (assert-superblock-all-zeroes md)
(with-bcache (cache md 1)
(with-block (b cache 0 (get-flags))
(unless (all-zeroes? (block-data b) 4096)