vos: convertROtoRW does not respect volume lock

vos convertROtoRW was not checking the return code from
ubik_VL_SetLock().

Change-Id: I651c543f9a0070a9d34d9cca7583437e50e95dc8
Reviewed-on: http://gerrit.openafs.org/7388
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Mark Vitale 2012-05-08 14:45:16 -04:00 committed by Derrick Brashear
parent 3a7dbe3315
commit 38ebd79baf

View File

@ -5612,6 +5612,13 @@ ConvertRO(struct cmd_syndesc *as, void *arock)
vcode = vcode =
ubik_VL_SetLock(cstruct, 0, entry.volumeId[RWVOL], RWVOL, ubik_VL_SetLock(cstruct, 0, entry.volumeId[RWVOL], RWVOL,
VLOP_MOVE); 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); aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
code = AFSVolConvertROtoRWvolume(aconn, partition, volid); code = AFSVolConvertROtoRWvolume(aconn, partition, volid);
if (code) { if (code) {
@ -5653,9 +5660,13 @@ ConvertRO(struct cmd_syndesc *as, void *arock)
"Warning: volume converted, but vldb update failed with code %d!\n", "Warning: volume converted, but vldb update failed with code %d!\n",
code); code);
} }
vcode = UV_LockRelease(entry.volumeId[RWVOL]); vcode = UV_LockRelease(entry.volumeId[RWVOL]);
if (vcode) { 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; return code;
} }