From 9e689e96099dba5227e62ea2c6069062daaac85a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 20 Jan 2011 01:23:37 -0500 Subject: [PATCH] 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. Change-Id: Icb928f7d2ec2342a57ed21b440ae0580c980e9d2 Reviewed-on: http://gerrit.openafs.org/3696 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/vol/ihandle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index e1c2ba3428..1bf19589aa 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -871,6 +871,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); @@ -883,7 +884,6 @@ ih_reallyclose(IHandle_t * ihP) } osi_Assert(ihP->ih_refcnt > 0); - ihP->ih_synced = 0; ih_fdclose(ihP);