From d4cf2fcda2aee14d1e312d8e145dd54f480ffeae Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 31 Dec 2000 14:09:38 +0000 Subject: [PATCH] ChangeLog, fsck.c: fsck.c (check_all): Call interpet_device to resolve LABEL= and UUID= right away so that the device_already_active() logic can do the right thing. Also cleaned up the the root filesystem logic checking code; fixed up a logic bug with the parallel_root option. --- misc/ChangeLog | 6 ++++++ misc/fsck.c | 40 +++++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index d11fd8c..3f03a3a 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,11 @@ 2000-12-31 + * fsck.c (check_all): Call interpet_device to resolve LABEL= and + UUID= right away so that the device_already_active() logic + can do the right thing. Also cleaned up the the root + filesystem logic checking code; fixed up a logic bug with + the parallel_root option. + * lsattr.1.in: Add pointer to chattr man page for definition of the file attributes. diff --git a/misc/fsck.c b/misc/fsck.c index 6ff0ec2..8084351 100644 --- a/misc/fsck.c +++ b/misc/fsck.c @@ -656,7 +656,7 @@ static int ignore(struct fs_info *fs) /* Are we ignoring this type? */ for(ip = ignored_types; *ip; ip++) - if (strcmp(fs->type, *ip) == 0) return(1); + if (strcmp(fs->type, *ip) == 0) return 1; /* Do we really really want to check this fs? */ for(ip = really_wanted; *ip; ip++) @@ -670,7 +670,7 @@ static int ignore(struct fs_info *fs) if (wanted) fprintf(stderr, _("fsck: cannot check %s: fsck.%s not found\n"), fs->device, fs->type); - return(1); + return 1; } /* We can and want to check this file system type. */ @@ -724,32 +724,35 @@ static int check_all(NOARGS) printf(_("Checking all file systems.\n")); /* - * Find and check the root filesystem first. + * Do an initial scan over the filesystem; mark filesystems + * which should be ignored as done, and resolve LABEL= and + * UUID= specifications to the real device. + */ + for (fs = filesys_info; fs; fs = fs->next) { + if (ignore(fs)) + fs->flags |= FLAG_DONE; + fs->device = interpret_device(fs->device); + } + + /* + * Find and check the root filesystem. */ if (!parallel_root) { for (fs = filesys_info; fs; fs = fs->next) { if (!strcmp(fs->mountpt, "/")) break; } - if (fs && !skip_root && !ignore(fs)) { - fs->device = interpret_device(fs->device); - fsck_device(fs->device, 1); + if (fs) { + if (!skip_root && !ignore(fs)) { + fsck_device(fs->device, 1); + status |= wait_all(); + if (status > EXIT_NONDESTRUCT) + return status; + } fs->flags |= FLAG_DONE; - status |= wait_all(); - if (status > EXIT_NONDESTRUCT) - return status; } } - if (fs) fs->flags |= FLAG_DONE; - /* - * Mark filesystems that should be ignored as done. - */ - for (fs = filesys_info; fs; fs = fs->next) { - if (ignore(fs)) - fs->flags |= FLAG_DONE; - } - while (not_done_yet) { not_done_yet = 0; pass_done = 1; @@ -778,7 +781,6 @@ static int check_all(NOARGS) /* * Spawn off the fsck process */ - fs->device = interpret_device(fs->device); fsck_device(fs->device, serialize); fs->flags |= FLAG_DONE; -- 1.8.3.1