When trying to deduce the diskname from the name so we can run

parallel fsck's one per drive, use the shortest prefix ending in
a digit rather than the longest prefix ending in a digit.

This makes "/dev/ad0s1a" and "/dev/ad0s2a" appear to both reside
on the disk "/dev/ad0" and consequently they will be fsck'ed
sequentially rather than in parallel as now.

In general this heuristic is rather soft and errorprone.  For
instance ccd may often reside on two or more physical disks.  A
good solution would be to look for passes larger than 1 until no
disks are found in a particular pass, that way people could put
ccd stripes in pass 3... and have them fsck'ed sequentially.

Reviewed by:	mjacob
This commit is contained in:
Poul-Henning Kamp 2000-12-27 22:28:40 +00:00
parent e3b4e866a5
commit 28b66787e0
2 changed files with 13 additions and 8 deletions

View File

@ -65,9 +65,9 @@ Filesystems with pass number 1 (normally just the root filesystem)
are checked one at a time.
When pass 1 completes, all remaining filesystems are checked,
running one process per disk drive.
The disk drive containing each filesystem is inferred from the longest prefix
The disk drive containing each filesystem is inferred from the shortest prefix
of the device name that ends in a digit; the remaining characters are assumed
to be the partition designator.
to be the partition and slice designator.
.Pp
The options are as follows:
.Bl -tag -width indent

View File

@ -259,12 +259,17 @@ finddisk(name)
size_t len = 0;
struct diskentry *d;
for (len = strlen(name), p = name + len - 1; p >= name; --p)
if (isdigit(*p)) {
len = p - name + 1;
break;
}
if (p < name)
p = strrchr(name, '/');
if (p == NULL)
p = name;
else
p++;
for (; *p && !isdigit(*p); p++)
continue;
for (; *p && isdigit(*p); p++)
continue;
len = p - name;
if (len == 0)
len = strlen(name);
TAILQ_FOREACH(d, &diskh, d_entries)