6

I'm trying to figure how is the sticky bit used in NFS v3. RFC 1813 says on page 22:

0x00200 Save swapped text (not defined in POSIX).

What do they mean by "swapped text"? In "NFS Illustrated", the author, Brent Callaghan, says it means not to cache. However, I haven't seen this explanation in other places.

5

The text section of an executable is the actual executable code, this is what it refers to. On Linux this request is ignored, it is just an optimisation, made by the admin. The kernel can do this for it self, without the prompt.

It is saying that if the executable text gets swapped out, and the process ends, then keep it for next time. On linux (local)executables are not swapped out, as it is as quick to reload from file. Maybe it is a bit different for NFS.

The sticky bit has other meanings for other file types: You described for executables. For directories, it stops non owners from deleting files.

I assume that nfs is the same, when I used it 20 years ago it was.


from: http://netbsd.gw.com/cgi-bin/man-cgi?sticky+7+NetBSD-current

Later, on SunOS 4, the sticky bit got an additional meaning for files that had the bit set and were not executable: read and write operations from and to those files would go directly to the disk and bypass the buffer cache. This was typically used on swap files for NFS clients on an NFS server, so that swap I/O generated by the clients on the servers would not evict useful data from the server's buffer cache.

  • 1
    What you described is the regular meaning of "sticky bit" in unix systems, no? I think it has a different meaning in NFS – dimid Nov 20 '13 at 12:50
  • @Dimid What makes you think the meaning is different? As far as I know, it isn't. – Gilles 'SO- stop being evil' Nov 20 '13 at 22:57
  • @Gilles, because the RFC states "(not defined in POSIX)" – dimid Nov 21 '13 at 9:07
  • 3
    @Dimid POSIX doesn't define it, but it's still the same thing from Unix. POSIX and Single Unix don't define that flag because it's deprecated, most current implementations support it but ignore it so it was kept out of the standard. It's a historical Unix thing that modern techniques have rendered obsolete. POSIX doesn't standardize it, but NFS still standardizes the flag value (while not saying what it should do beyond a terse description of the traditional Unix semantics). – Gilles 'SO- stop being evil' Nov 21 '13 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.