summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/pass1.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2014-01-02 01:44:14 +0000
committerscottl <scottl@FreeBSD.org>2014-01-02 01:44:14 +0000
commitcbabeda6695b7f6d82b13bdb27960b68b9357554 (patch)
tree4d289d7c3e2452eaa1f2451291d10994b71d58fc /sbin/fsck_ffs/pass1.c
parent1969ab94ba386458e83f8b44cd7ad14144437aea (diff)
downloadFreeBSD-src-cbabeda6695b7f6d82b13bdb27960b68b9357554.zip
FreeBSD-src-cbabeda6695b7f6d82b13bdb27960b68b9357554.tar.gz
MFC r260068, r260069, r260076
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 Obtained from: Netflix
Diffstat (limited to 'sbin/fsck_ffs/pass1.c')
-rw-r--r--sbin/fsck_ffs/pass1.c5
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;
OpenPOWER on IntegriCloud