[OpenAFS] File locking

Charles Clancy security@xauth.net
Mon, 6 Jan 2003 23:33:44 -0600 (CST)


>  >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?

It will see the new one.  Why?  Because OpenAFS has a functional cache
coherency protocol.  Otherwise, no one would use it.  ;)

Basically, the file server breaks it's callback (guarantee that no one has
modified the file) with all the cache managers (client machines) who have
a cached copy.

There's a complete description in the wiki, AdminFAQ section 3.07:

http://grand.central.org/twiki/bin/view/AFSLore/AdminFAQ#3_07_How_does_AFS_maintain_consi

[ t charles clancy ]--[ tclancy@uiuc.edu ]--[ www.uiuc.edu/~tclancy ]