PrintError("", code);
else
fprintf(STDERR, "Unknown volume ID or name '%s'\n",
- as->parms[0].items->data);
+ as->parms[2].items->data);
return -1;
}
if (as->parms[3].items)
fprintf(STDERR,
"Could not fetch the entry for volume %lu from VLDB\n",
(unsigned long)volid);
- PrintError("convertROtoRW", code);
+ PrintError("convertROtoRW ", vcode);
return vcode;
}
rwindex = i;
rwserver = entry.serverNumber[i];
rwpartition = entry.serverPartition[i];
- }
- if (entry.serverFlags[i] & ITSROVOL) {
+ if (roserver)
+ break;
+ } else if ((entry.serverFlags[i] & ITSROVOL) && !roserver) {
same = VLDB_IsSameAddrs(server, entry.serverNumber[i], &code);
if (code) {
fprintf(STDERR,
roindex = i;
roserver = entry.serverNumber[i];
ropartition = entry.serverPartition[i];
- break;
+ if (rwserver)
+ break;
}
}
}
vcode =
ubik_VL_SetLock(cstruct, 0, entry.volumeId[RWVOL], RWVOL,
VLOP_MOVE);
+ if (vcode) {
+ fprintf(STDERR,
+ "Unable to lock volume %lu, code %d\n",
+ (unsigned long)entry.volumeId[RWVOL],vcode);
+ PrintError("", vcode);
+ return -1;
+ }
aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
code = AFSVolConvertROtoRWvolume(aconn, partition, volid);
if (code) {
"Converting RO volume %lu to RW volume failed with code %d\n",
(unsigned long)volid, code);
PrintError("convertROtoRW ", code);
- return -1;
+ goto error_exit;
}
entry.serverFlags[roindex] = ITSRWVOL;
entry.flags |= RW_EXISTS;
"Warning: volume converted, but vldb update failed with code %d!\n",
code);
}
+
+ error_exit:
vcode = UV_LockRelease(entry.volumeId[RWVOL]);
if (vcode) {
- PrintDiagnostics("unlock", vcode);
+ fprintf(STDERR,
+ "Unable to unlock volume %lu, code %d\n",
+ (unsigned long)entry.volumeId[RWVOL],vcode);
+ PrintError("", vcode);
}
return code;
}
if (as->parms[13].items)
secFlags |= AFSCONF_SECOPTS_NOAUTH;
- if (as->parms[14].items) /* -serverauth specified */
+ if (as->parms[14].items) { /* -localauth specified */
secFlags |= AFSCONF_SECOPTS_LOCALAUTH;
+ confdir = AFSDIR_SERVER_ETC_DIRPATH;
+ }
if (as->parms[16].items /* -encrypt specified */
#ifdef AFS_NT40_ENV