Re: Bug#25228: change to savelog works on "lock"ed NFS partitions
Richard Braakman wrote:
>Guy Maor wrote:
>> Richard Braakman <email@example.com> writes:
>> > You were probably thinking of a process that _starts_ logging to that
>> > filename, after the first mv and before the second mv. It might
>> > create a new log file, which will then be unlinked by the second mv
>> > and the process will end up logging to an unlinked file.
>> Yes, so I'll just add an extra rm before the mv as you, Brian,
>> suggested earlier.
>That still leaves the same possibility open, between the rm and the mv.
>I doubt that there is any other way than ln followed by mv to switch
>log files atomically.
I knew that had to be some reason why it was done that way :-(
Maybe it could be said that this is a kernel/nfs bug as:
mv a b
Should be the atomic equivalent to:
mv a b
(at least I think this is correct).
ie it shouldn't complain if b is locked, since rm works even if the file is
Brian May <firstname.lastname@example.org>
To UNSUBSCRIBE, email to email@example.com
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org