.
D 2004-04-09T14:11:39
J assignee vincentdarley
J cmimetype text/plain
J comment \nThe\sinteral\srep\sof\sa\s"path"\sTcl_Obj\ncan\sremember\sthings,\slike\swhich\nfilesystem\shas\sclaimed\sit.\s\sEach\n"path"\sTcl_Obj\sremembers\sa\nfilesystemEpoch\svalue,\sto\shelp\ndetermine\swhether\sthe\scached\ninformation\sstill\sagrees\swith\sthe\nauthoritative\sdata\sstructures.\n\nThe\sepoch\svalue\schecking\sdone\nwithin\stclPathObj.c\salways\scompares\nthe\sfilesystemEpoch\svalue\sin\sthe\s"path"\nto\sthe\stsdPtr->filesystemEpoch\svalue,\nwhich\scharacterizes\sthe\slocal\sthread's\ncopy\sof\sthe\smaster\sfilesystem\sdata\sstructures.\n\nThat\swill\skeep\sthe\s"path"\svalues\sconsistent\nwith\sthe\sthread's\sview\sof\sthe\sfilesystem\nstate,\sI\sagree.\n\nHowever,\sthe\sTcl_FSRegister(),\nTcl_FSUnregister(),\sand\sTcl_FSMountsChanged()\nroutines\sall\sdirectly\smanipulate\sthe\nmaster\sper-process\sfilesystem\sdata.\nThe\sper-thread\scache\sof\sthat\sdata\swill\nbe\sout\sof\sdate\suntil\ssome\sroutine\sin\nthe\sthread\scalls\sFsGetFirstFilesystem()\nin\stclIOUtil.c.\n\nIt\sappears\sto\sme\sthen,\sthat\sthe\sepoch\nchecking\sof\s"path"\svalues\sisn't\sreally\nchecking\svalidity\sunless\ssomehow\nthreads\sare\sprompted\sto\scall\nFsGetFirstFilesystem()\swhen\sthe\nmaster\sdata\schanges.\n\nAs\sone\sexample,\sconsider\nTcl_FSGetFilesystemForPath().\nIt\scalls\sTclFSEnsureEpochOk()\nwhich\swill\scheck\sthat\sthe\sepoch\nwithin\sthe\s"path"\sis\sthe\ssame\sas\nthat\sof\sthe\sthread's\scopy\sof\sthe\nfilesystem.\s\sIf\sso,\sthen\sthe\scached\nfilesystem\sthat\sclaimed\sthis\s"path"\nbefore\sis\sreturned.\n\nOnly\slater\sin\sTcl_FSGFFP()\sis\nFsGetFirstFilesystem()\scalled,\nso\sthat\sit\smight\sbe\snoticed\sthat\sthe\nfilesystem\sreturn\sis\sinvalid\s(perhaps\nnow\sunregistered!\s\sor\sperhaps\sjust\nmounting\schanges\shave\schanged\nthe\sfilesystem\sthat\shas\sa\svalid\sclaim)\n\nThat\sparticular\sexample\scan\sprobably\nbe\sfixed\sby\smoving\sthe\sFsGetFirstFilesystem()\ncall\sbefore\sthe\sTclFSEnsureEpochOk()\scall,\nbut\sI'm\salso\scurious\sabout\sthe\sgeneral\sissue\nof\skeeping\sper-thread\scaches\sin\ssync\swith\nthe\smaster\sdata.
J foundin obsolete:\s8.5a2
J priority 5\sMedium
J resolution None
J status Open
J submitter dgp
J subsystem 37.\sFile\sSystem
J title epoch\ssafety\sin\sthreads?
J type Bug
K 932314ffffffffffffffffffffffffffffffffff
U dgp
Z c71939e67282be8bba75be091c1b3538