From fcb49d06544cf8bce5f654b95c491f3961fa9c91 Mon Sep 17 00:00:00 2001 From: Dan Hyde Date: Tue, 2 Feb 2010 10:37:47 -0500 Subject: [PATCH] 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: I28aa02488a6b53dc9f9aa9b2053c71d29222bdaf Reviewed-on: http://gerrit.openafs.org/1213 Reviewed-by: Dan Hyde Tested-by: Dan Hyde (cherry picked from commit 105481d3348a93d33695fb705f9fa5c8af210e7e) Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear Reviewed-on: http://gerrit.openafs.org/1595 (cherry picked from commit 3c1d60a19ccdc23ecd9eb0ca79bd72816abcd82e) --- src/volser/volprocs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 1bbc1e438..6b15476a6 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -95,7 +95,7 @@ VolSetIdsTypes(), VolSetDate(), VolSetFlags(); /* this call unlocks all of the partition locks we've set */ int -VPFullUnlock() +VPFullUnlock_r(void) { register struct DiskPartition64 *tp; for (tp = DiskPartitionList; tp; tp = tp->next) { @@ -107,6 +107,16 @@ VPFullUnlock() 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) -- 2.39.5