[OpenAFS] File locking

Jayme Cox jayme@reality.net
Mon, 06 Jan 2003 21:19:14 -0800


>>We have 15 or so openAFS clients (mix of linux and windows) mounting an
>>AFS drive over the internet. An application writes a file to the openAFS
>>server from client #1 and another application begins to read that same
>>file on client #2 microseconds later.
>>What version of the file will client #2 read?
>>
>>I guess my question boils down to: 
>>Does client #2 ask the server if the file is being written (changed)
>>every time it does a read? Or does it only ask when it's gotten a 'this
>>file has been modified notification'?

 >Derek Atkins wrote:
 > Synchronization is based on file open/close, not read/write.  If
 > client 1 close()es the file before client 2 open()s it, then it will
 > see the new one.  Otherwise it will see the old one.

Client #1 close()es file XYZ and a few microseconds later client #2 
open()s file XYZ
Does client #2 see the one it has in local cache or the one that client 
#1 just finished close()ing?
How does client #2 know that the file has changed? Does it ask the 
openAFS server before it open()s it or does it depend on the openAFS 
server sending out a change notification?

Thanks!