From 2a72c274119ee787d5ce4027d6b5a7dcd1de6960 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Tue, 8 May 2012 14:45:16 -0400 Subject: [PATCH] vos: convertROtoRW does not respect volume lock vos convertROtoRW was not checking the return code from ubik_VL_SetLock(). Reviewed-on: http://gerrit.openafs.org/7388 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear (cherry picked from commit 38ebd79bafee3c97323aa603906d1d5f279ec450) Change-Id: I391c5b0d3d385af08eb2aec245f943081c7b84e3 Reviewed-on: http://gerrit.openafs.org/7498 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/volser/vos.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/volser/vos.c b/src/volser/vos.c index e5197e2c5..f0c2176f1 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -5623,6 +5623,13 @@ ConvertRO(struct cmd_syndesc *as, void *arock) 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) { @@ -5664,9 +5671,13 @@ ConvertRO(struct cmd_syndesc *as, void *arock) "Warning: volume converted, but vldb update failed with code %d!\n", code); } + 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; } -- 2.39.5