Do not corrupt volume linktable when special file already exists

Upon volume creation, when a special file unexpectedly exists, e.g. due
to a failed cleanup, do not blindly assume that it is the link table.
Otherwise the latter's magic will get silently overwritten.

Change-Id: Iba05ae771e04272a3dab5534fcfc24cda5ee7df5
Reviewed-on: http://gerrit.openafs.org/1903
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Rainer Toebbicke 2010-05-04 14:11:30 +02:00 committed by Derrick Brashear
parent 95636c6fac
commit e489c44328

View File

@ -217,7 +217,7 @@ VCreateVolume_r(Error * ec, char *partname, VolId volumeId, VolId parentId)
(p->inodeType == VI_LINKTABLE) ? vol.parentId : vol.id,
INODESPECIAL, p->inodeType, vol.parentId);
if (!(VALID_INO(*(p->inode)))) {
if (errno == EEXIST) {
if (errno == EEXIST && (p->inodeType == VI_LINKTABLE)) {
/* Increment the reference count instead. */
IHandle_t *lh;
int code;