[476] in Info-AFS_Redistribution
fsync() and close()
daemon@ATHENA.MIT.EDU (Calvin Clark)
Tue Dec 3 12:31:27 1991
Date: Tue, 3 Dec 91 10:56:53 -0500
From: Calvin Clark <ckclark@athena.mit.edu>
To: info-afs@transarc.com
Reply-To: ckclark@MIT.EDU
I would like an explanation of what fsync() and close() do on an AFS
filesystem. The documentation I have seems to indicate that a call to
write() will only modify the version of the file cached on the client
machine, and that the modifications are not communicated to the server
until a call to fsync() or close() is made. I would like to know
whether it is sufficient to check the exit status of close() in order to
insure that a file has been safely written to the server, or whether a
call to fsync() is also necessary, and why.
(The reason I am asking this is that I am sending in changes to
movemail.c in the GNU Emacs distribution because some users at my site
with AFS home directories have lost mail trying to run RMAIL while over
quota because movemail was not checking the success of the close(). We
use POP servers, and movemail will delete messages from the server if it
thinks it has retrieved them safely and written them to the user's RMAIL
file.)
By the way, I plan on sending my changes in very soon, so I'd like an
accurate explanation ASAP to give with them so that they will be more
likely to make it into the next version of GNU Emacs. Thanks in advance
for your help.
-Calvin
--
Calvin Clark <ckclark@mit.edu>
MIT Distributed Computing and Network Services
Systems Development and Quality Assurance