diff options
author | scottl <scottl@FreeBSD.org> | 2013-12-30 01:16:08 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2013-12-30 01:16:08 +0000 |
commit | f0d9289d4bc1cea75e6ade6e0b1496020b81d254 (patch) | |
tree | 3f5b4ba557bcb5004e79798d6d96972dfe7d2e45 /sbin/fsck_ffs/pass1.c | |
parent | 3652e600422dfba0018864e0430f86f9fae07bbd (diff) | |
download | FreeBSD-src-f0d9289d4bc1cea75e6ade6e0b1496020b81d254.zip FreeBSD-src-f0d9289d4bc1cea75e6ade6e0b1496020b81d254.tar.gz |
Add the -R option to allow fsck_ffs to restart itself when too many critical
errors have been detected in a particular run.
Clean up the global state variables so that a restart can happen correctly.
Separate the global variables in fsck_ffs and fsdb to their own file. This
fixes header sharing with fscd.
Correctly initialize, static-ize, and remove global variables as needed in
dir.c. This fixes a problem with lost+found directories that was causing
a segfault.
Correctly initialize, static-ize, and remove global variables as needed in
suj.c.
Initialize the suj globals before allocating the disk object, not after.
Also ensure that 'preen' mode doesn't conflict with 'restart' mode
Submitted by: scottl, max
Reviewed by: max, mckusick (earlier version)
Obtained from: Netflix
MFC after: 3 days
Diffstat (limited to 'sbin/fsck_ffs/pass1.c')
-rw-r--r-- | sbin/fsck_ffs/pass1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 3199541..67fba6e 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -68,6 +68,8 @@ pass1(void) u_int8_t *cp; int c, rebuildcg; + badblk = dupblk = lastino = 0; + /* * Set file system reserved blocks in used block map. */ @@ -463,6 +465,7 @@ pass1check(struct inodesc *idesc) ckfini(0); exit(EEXIT); } + rerun = 1; return (STOP); } } @@ -483,6 +486,7 @@ pass1check(struct inodesc *idesc) ckfini(0); exit(EEXIT); } + rerun = 1; return (STOP); } new = (struct dups *)Malloc(sizeof(struct dups)); @@ -492,6 +496,7 @@ pass1check(struct inodesc *idesc) ckfini(0); exit(EEXIT); } + rerun = 1; return (STOP); } new->dup = blkno; |