[PATCH] syslogd: Possible endless loop when reinitializing after power loss
Rich Felker
dalias at aerifal.cx
Tue Oct 25 20:27:50 UTC 2011
On Tue, Oct 25, 2011 at 02:25:23PM +0200, Christian Engelmayer wrote:
> >> Sounds like this bug report belongs on LKML or the bug tracker for
> >> these filesystems...
>
> You are right that applications normally shall not cover up file system
> design issues. In this case also have a look on the Linux man page on
> rename():
>
> However, when overwriting there will probably be a window in which both
> oldpath and newpath refer to the file being renamed.
>
> Regardless of the steps leading to the problematic condition - file system
> behaviour after power loss or malicious manipulation - the 'goto repopen'
> construct in log_locally() leads to trouble in case the assumptions on
> rename during the file rotation do not hold as expected.
>
> In my opinion the proposed patch introducing the additional call to
> unlink() does not harm the common case, but makes the code more robust
> with the smallest possible changeset.
I'm undecided on its merits at this point, but isn't it possible that
your proposed patch deletes a newly-created file even in the absence
of power failure issues??
Rich
More information about the busybox
mailing list