]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Do not corrupt volume linktable when special file already exists
authorRainer Toebbicke <rtb@pclella.cern.ch>
Tue, 4 May 2010 12:11:30 +0000 (14:11 +0200)
committerDerrick Brashear <shadow@dementia.org>
Wed, 23 Jun 2010 21:53:02 +0000 (14:53 -0700)
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>
src/vol/vutil.c

index bbd2ef0c8466604b588e2642b021657147dbec67..404273afe839a723dd53dde618547808a655bfb6 100644 (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;