viced: Set HWHO_INPROGRESS in CheckHost_r
authorAndrew Deason <adeason@sinenomine.net>
Fri, 4 Mar 2011 17:35:06 +0000 (11:35 -0600)
committerDerrick Brashear <shadow@dementia.org>
Fri, 4 Mar 2011 20:26:08 +0000 (12:26 -0800)
When we are probing a host in CheckHost_r, set the HWHO_INPROGRESS
flag on the host, so other threads know that the host is locked while
we are waiting for a probe response, and the h_threadquota mechanism
can work correctly.

Change-Id: I37e3b37ea98d8d42578bf85a3b5aaaff4c4a7331
Reviewed-on: http://gerrit.openafs.org/4126
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/viced/host.c

index fae7a9c..ef24967 100644 (file)
@@ -3837,6 +3837,7 @@ CheckHost_r(struct host *host, int flags, void *dummy)
     if (host->LastCall < checktime) {
        h_Lock_r(host);
        if (!(host->hostFlags & HOSTDELETED)) {
+           host->hostFlags |= HWHO_INPROGRESS;
            cb_conn = host->callback_rxcon;
            rx_GetConnection(cb_conn);
            if (host->LastCall < clientdeletetime) {
@@ -3904,6 +3905,7 @@ CheckHost_r(struct host *host, int flags, void *dummy)
            rx_PutConnection(cb_conn);
            cb_conn=NULL;
            H_LOCK;
+           host->hostFlags &= ~HWHO_INPROGRESS;
        }
        h_Unlock_r(host);
     }