summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/dir.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/dir.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/dir.c')
-rw-r--r--sbin/fsck_ffs/dir.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c
index 965e3e3..7640f70 100644
--- a/sbin/fsck_ffs/dir.c
+++ b/sbin/fsck_ffs/dir.c
@@ -48,20 +48,14 @@ __FBSDID("$FreeBSD$");
#include "fsck.h"
-const char *lfname = "lost+found";
-int lfmode = 0700;
-struct dirtemplate emptydir = {
+static struct dirtemplate emptydir = {
0, DIRBLKSIZ, DT_UNKNOWN, 0, "",
0, 0, DT_UNKNOWN, 0, ""
};
-struct dirtemplate dirhead = {
+static struct dirtemplate dirhead = {
0, 12, DT_DIR, 1, ".",
0, DIRBLKSIZ - 12, DT_DIR, 2, ".."
};
-struct odirtemplate odirhead = {
- 0, 12, 1, ".",
- 0, DIRBLKSIZ - 12, 2, ".."
-};
static int chgino(struct inodesc *);
static int dircheck(struct inodesc *, struct direct *);
@@ -133,6 +127,7 @@ dirscan(struct inodesc *idesc)
(size_t)dsize);
dirty(bp);
sbdirty();
+ rerun = 1;
}
if (n & STOP)
return (n);
OpenPOWER on IntegriCloud