]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vos: convertROtoRW does not respect volume lock
authorMark Vitale <mvitale@sinenomine.net>
Tue, 8 May 2012 18:45:16 +0000 (14:45 -0400)
committerDerrick Brashear <shadow@dementix.org>
Tue, 29 May 2012 00:31:22 +0000 (17:31 -0700)
vos convertROtoRW was not checking the return code from
ubik_VL_SetLock().

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>
(cherry picked from commit 38ebd79bafee3c97323aa603906d1d5f279ec450)

Change-Id: I391c5b0d3d385af08eb2aec245f943081c7b84e3
Reviewed-on: http://gerrit.openafs.org/7498
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/volser/vos.c

index e5197e2c5a911730dc7340de8fa6b71d9621533c..f0c2176f11e2c473f42452ece77fd6052b2c5ccc 100644 (file)
@@ -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;
 }