From: Garry Zacheiss Date: Mon, 17 Nov 2003 23:21:52 +0000 (+0000) Subject: callbacks-later-locking-order-20031117 X-Git-Tag: openafs-devel-1_3_50~21 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=63ba8d77fb139abdde915b5b44318edc9bc1bcbd callbacks-later-locking-order-20031117 be consistent in the order we hold H_LOCK and FSYNC_LOCK; in this case acquire FSYNC_LOCK as needed. --- diff --git a/src/viced/callback.c b/src/viced/callback.c index 55af2b9..ef27589 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -1408,6 +1408,7 @@ BreakLaterCallBacks(void) /* Unchain first */ ViceLog(25, ("Looking for FileEntries to unchain\n")); H_LOCK; + FSYNC_LOCK; /* Pick the first volume we see to clean up */ fid.Volume = fid.Vnode = fid.Unique = 0; @@ -1430,14 +1431,14 @@ BreakLaterCallBacks(void) feip = &fe->fnext; } } + FSYNC_UNLOCK; if (!myfe) { - H_UNLOCK; + H_UNLOCK return 0; } /* loop over FEs from myfe and free/break */ - FSYNC_UNLOCK; tthead = 0; for (fe = myfe; fe;) { register struct CallBack *cbnext; @@ -1475,8 +1476,7 @@ BreakLaterCallBacks(void) henumParms.ncbas = 0; } } - FSYNC_LOCK; - H_UNLOCK;; + H_UNLOCK; /* Arrange to be called again */ return 1; diff --git a/src/viced/viced.c b/src/viced/viced.c index e9db54d..f00d3e9 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -498,6 +498,7 @@ FsyncCheckLWP() if ((code = LWP_WaitProcess(fsync_wait)) != LWP_SUCCESS) ViceLog(0, ("LWP_WaitProcess returned %d\n", code)); #endif /* AFS_PTHREAD_ENV */ + FSYNC_UNLOCK; ViceLog(2, ("Checking for fsync events\n")); do { code = BreakLaterCallBacks();