[PATCH] syslogd: Possible endless loop when reinitializing after power loss

Matthias Andree mandree at FreeBSD.org
Tue Oct 25 18:24:03 UTC 2011


Am 25.10.2011 01:57, schrieb Rich Felker:
> On Tue, Oct 25, 2011 at 12:52:42AM +0200, Christian Engelmayer wrote:
>> Function log_locally() within the syslogd can potentially lock up when
>> restarting the daemon after a power loss in case the unplanned shutdown hit the
>> rename operation during logfile rotation.
>>
>> While POSIX requires the rename operation to be atomic, many file systems such
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> as JFFS2 implement the rename operation in 2 steps by linking the new name
>> followed by unlinking the original name. In case of a power loss during the
> 
> Sounds like this bug report belongs on LKML or the bug tracker for
> these filesystems...

Indeed, but some sort of journal recovery, or fsck would have to clean
up the mess -- and the question is, why isn't it run beforehand?

On the other hand, if the file system state can be created through an
admin accident, too, and is easy to detect/work around, that's what we
should do -- because the unterminated loop isn't specific to a file
system bug.


More information about the busybox mailing list