[OpenAFS] sqlite on AFS will not work, even with whole-file locking

Hans-Werner Paulsen hans@MPA-Garching.MPG.DE
Thu, 22 Apr 2010 09:42:45 +0200


On Wed, Apr 21, 2010 at 09:48:27AM -0400, Derrick Brashear wrote:
> if you opened it O_RDWR on this client, it better have a valid callback.
>=20
> if it's modified and you still have it open, the callback is broken.
> if the client doesn't refetch, it's a bug, and it has nothing to do
> with locking particularly.

I do not know the exact semantics of the AFS filesystem, and therefore I
do not know that it is a bug. Is it really a bug?
Running the following program on machine A

  fd =3D open("xxx",O_RDONLY);
  while (1) {
    ret =3D fstat(fd,&buf);
    printf("size: %d  mtime: %s",(int)buf.st_size,ctime(&(buf.st_mtime)))=
;
    sleep(1);
  }

and modifying "xxx" on machine B (e.g. echo "J" >>xxx) reports me the
up-to-date information on machine A.
But, when I open the file with
  fd =3D open("xxx",O_RDWR);
the stat-information is never updated.
This is on i386_linux26 with 1.4.12, but I have seen this behavior foreve=
r.

Best regards,
HW

--=20
Hans-Werner Paulsen		hans@MPA-Garching.MPG.DE
MPI f=FCr Astrophysik		Tel 089-30000-2602
Karl-Schwarzschild-Str. 1	Fax 089-30000-2235=09
D-85741 Garching