Currently, servers attempt to attach any partition name starting with
"/vicep", even partition names which map to out of range partition ids.
Examples of such misnamed partitions are "/vicepzz", "/vicep0", and
others.
The presence of these misnamed partitions cause the server processes to
crash on startup, since the out of range partition ids are used as an
index.
Add a check for the bad partition names in VCheckPartitions to avoid
attaching them. Log a warning for such partitions to let the admins know
why the partitions are not attached.
Change-Id: I553ce6cc8bc751b9ed789312f7efb4e0f737a52e
Reviewed-on: https://gerrit.openafs.org/13038
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
if (strncmp(part, VICE_PARTITION_PREFIX, VICE_PREFIX_SIZE)) {
return 0;
}
+ if (volutil_GetPartitionID(part) == -1) {
+ Log("Warning: %s is a bad partition name; ignored.\n", part);
+ return 0;
+ }
if (afs_stat(part, &status) < 0) {
Log("VInitVnodes: Couldn't find file system %s; ignored\n", part);
return 0;