2 ms·
To learn the basics about NFS, read chapter 14 of the Unix haters handbook” (http://simson.net/ref/ugh.pdf http://simson.net/ref/ugh.pdf) ”By design, NFS is co
by Someone 8y ago
To learn the basics about NFS, read chapter 14 of the Unix haters handbook” (http://simson.net/ref/ugh.pdf http://simson.net/ref/ugh.pdf)
”By design, NFS is connectionless and stateless. In practice, it is neither. This conflict between design and implementation is at the root of most NFS problems.
File systems, by their very nature, have state. You can only delete a file once, and then it’s gone. That’s why, if you look inside the NFS code, you’ll see lots of hacks and kludges—all designed to impose state on a stateless protocol.”
It goes on to mention some issues that NFS wouldn’t handle if it were truly stateless and connectionless:
”NFS is stateless, but many programs designed for Unix systems require record locking in order to guarantee database consistency.
[…]
NFS is based on UDP; if a client request isn’t answered, the client resends the request until it gets an answer. If the server is doing something time-consuming for one client, all of the other clients who want file service will continue to hammer away at the server with duplicate and triplicate NFS requests, rather than patiently putting them into a queue and waiting for the reply.
[…]
If you delete a file in Unix that is still open, the file’s name is removed from its directory, but the disk blocks associated with the file are not deleted until the file is closed. This gross hack allows programs to create temporary files that can’t be accessed by other programs. (This is the second way that Unix uses to create temporary files; the other technique is to use the mktmp() function and create a temporary file in the /tmp directory that has the process ID in the filename. Deciding which method is the grosser of the two is an exercise left to the reader.) But this hack doesn’t work over NFS. The stateless protocol doesn't know that the file is “opened” — as soon as the file is deleted, it's gone.”