]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
VOL_LOCK needed when traversing DiskPartitionList
authorDan Hyde <drh@umich.edu>
Tue, 2 Feb 2010 15:37:47 +0000 (10:37 -0500)
committerRuss Allbery <rra@debian.org>
Tue, 4 May 2010 21:32:45 +0000 (14:32 -0700)
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 <drh@umich.edu>
Tested-by: Dan Hyde <drh@umich.edu>
(cherry picked from commit 105481d3348a93d33695fb705f9fa5c8af210e7e)
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/1595
(cherry picked from commit 3c1d60a19ccdc23ecd9eb0ca79bd72816abcd82e)

src/volser/volprocs.c

index 1bbc1e438a9bd5d96cd01255b46a688a3f4b910a..6b15476a6df2a0de4791a0d0b093cbda9fc68cec 100644 (file)
@@ -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)