Re: Bug#25228: change to savelog works on "lock"ed NFS partitions
Richard Braakman wrote:
>Guy Maor wrote:
>> Richard Braakman <dark@xs4all.nl> 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:
rm b
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
locked.
Comments?
Brian May <bam@snoopy.apana.org.au>
--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: