From: Jeffrey Altman Date: Thu, 20 Jan 2011 06:23:37 +0000 (-0500) Subject: vol: clear ih_synced before dropping lock X-Git-Tag: upstream/1.6.0.pre2^2~64 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ca1916ea8f9ce467a429a6dc8c239e46247ff4f7;p=packages%2Fo%2Fopenafs.git vol: clear ih_synced before dropping lock in ih_reallyclose() clear ihP->ih_synced before dropped the IH_LOCK. ih_reallyclose() is already committed to performing the OS_SYNC() call. Failing to clear the ih_synced flag before dropping the lock permits another thread, the ih_sync_all() thread for example, to also conclude that it must sync the file. Reviewed-on: http://gerrit.openafs.org/3696 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 9e689e96099dba5227e62ea2c6069062daaac85a) Change-Id: I18baf1e1cd409a108845c2db2cb38144593016c8 Reviewed-on: http://gerrit.openafs.org/3845 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index 3e8a5c838..b57929d31 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -870,6 +870,7 @@ ih_reallyclose(IHandle_t * ihP) ihP->ih_refcnt++; /* must not disappear over unlock */ if (ihP->ih_synced) { FdHandle_t *fdP; + ihP->ih_synced = 0; IH_UNLOCK; fdP = IH_OPEN(ihP); @@ -882,7 +883,6 @@ ih_reallyclose(IHandle_t * ihP) } osi_Assert(ihP->ih_refcnt > 0); - ihP->ih_synced = 0; ih_fdclose(ihP);