From: Dan Hyde Date: Tue, 2 Feb 2010 15:37:47 +0000 (-0500) Subject: VOL_LOCK needed when traversing DiskPartitionList X-Git-Tag: openafs-devel-1_5_73~44 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=105481d3348a93d33695fb705f9fa5c8af210e7e VOL_LOCK needed when traversing DiskPartitionList VLockPartition sets VOL_LOCK, opens (perhaps creating) the lock file for a partition, and flock's it. VUnlockPartition, sets VOL_LOCK, and closes the lock file fd. VLockPartition is called from the salvager. Nothing ever calls VUnlockPartition. VPFullUnlock is called every 30 seconds, does NOT set VOL_LOCK, and happily closes any lock file fd it finds, breaking any lock set with flock. Other routines use the VOL_LOCK when traversing DiskPartitionList. Change-Id: I683547f574b1f760e72014f5d44ce3987f07b5df Reviewed-on: http://gerrit.openafs.org/1213 Reviewed-by: Dan Hyde Tested-by: Dan Hyde Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 5838008..8de0c41 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -134,7 +134,7 @@ static afs_int32 VolSetDate(struct rx_call *, afs_int32, afs_int32); /* this call unlocks all of the partition locks we've set */ int -VPFullUnlock(void) +VPFullUnlock_r(void) { register struct DiskPartition64 *tp; for (tp = DiskPartitionList; tp; tp = tp->next) { @@ -146,6 +146,16 @@ VPFullUnlock(void) return 0; } +int +VPFullUnlock(void) +{ + int code; + VOL_LOCK; + code = VPFullUnlock_r(); + VOL_UNLOCK; + return code; +} + /* get partition id from a name */ afs_int32 PartitionID(char *aname)