From b87935a4c5f26357e29f1db46eff8b1cf9185f3b Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 24 Apr 2008 23:44:01 +0000 Subject: [PATCH] vos-move-avoid-spurious-unlock-20080424 LICENSE IPL10 lightly modified from what Bren Mills submitted; the second unlock call after mfail may be entirely useless. --- src/volser/vsprocs.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index fa44258dec..6d3ac5e681 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -1790,6 +1790,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart, ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1, (LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP)); VDONE; + islocked = 0; } if (clonetid) { @@ -1995,12 +1996,14 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart, } /* unlock VLDB entry */ - VPRINT1("Recovery: Releasing lock on VLDB entry for volume %u ...", - afromvol); - ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1, - (LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP)); - VDONE; - + if (islocked) { + VPRINT1("Recovery: Releasing lock on VLDB entry for volume %u ...", + afromvol); + ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1, + (LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP)); + VDONE; + islocked = 0; + } done: /* routine cleanup */ if (volName) free(volName);