[OpenAFS] File locking

Jayme Cox jayme@reality.net
Tue, 7 Jan 2003 11:04:25 -0800


> 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_A
FS_maintain_consi

I've read through the wiki FAQ and am still not clear on HOW it breaks
it's callback. The reason I'm asking this is we are using openAFS as the
servervault for 15 Neverwinter Nights servers. A player can "portal"
from one server to another, so the NWN client tells server #1 to save
it's .bic file (close()), then the NWN client immediately connects to
server #2 and loads the same .bic file (open()). We are seeing problems
where the .bic file is incomplete/corrupted when open()ed on server #2
and are trying to trace down the cause.

Server #1 (yes, it does a double open/close):
  open("./servervault/megaplex/test.bic", O_WRONLY|O_CREAT|O_TRUNC,
0666)
  write(...)
  close()
  ...
  open("./servervault/megaplex/test.bic", O_WRONLY|O_CREAT|O_TRUNC,
0666)
  write(...)
  close()

Server #2:
  open("./servervault/megaplex/test.bic", O_RDONLY) 
  llseek()
  read(...)
  close()

Depending on the speed of the NWN client, it may ask server #2 to open()
the .bic file 10 ms after it told server #1 to save the file.

Is it possible for server #2 to open() the .bic file before the openAFS
server has broken it's callback?

Thanks!