Skip to contentSkip to conversation

Swap

DISCUSSION Dan Maas 2 participants 2 messages Nov 20, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dan Maas

author
#1 lore raw
Quoted 4 lines

This is 'nice' for the server, it doesn't have the overhead of maintaining a file-system state. That's why servers are supposed to be read-only. However, somebody has got to write the stuff to the file-system that's going to (eventually) be read-only. Beware when such access occurs.

But NFS still allows atomic rename() right? Isn't it considered essential to write the new executable or library under a different name, and then atomically rename() over the old one? If you write() directly into the executable, you will get what you deserve...

Regards,
Dan

#2 lore raw
In reply to a message not in the archive
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Dan Maas <[email protected]> writes:

> But NFS still allows atomic rename() right? Isn't it considered > essential to write the new executable or library under a > different name, and then atomically rename() over the old one? > If you write() directly into the executable, you will get what > you deserve...

Atomic rename works fine, on NFS, so if you just rename the old library, you're quite safe. The bugs start to surface if you:

a) Reuse the the old library's inode by doing something along the lines of open("lib.so",O_TRUNC|O_WRONLY).
or
b) erase the old library.

Cheers,
Trond