On Thu, 2009-01-22 at 12:21 +1100, Paul Wankadia wrote:
> On Wed, Jan 21, 2009 at 4:29 PM, Ian Kent <ra...@themaw.net> wrote:
> 
>         
>         > In this case, make_fullpath() is called from only one place
>         and its
>         > return value is checked, but I was asking in general, yes.
>         
>         
>         Not sure I understand the question.
>         
>         Functions like make_fullpath() need to return a NULL in such a
>         case
>         because it has to be up to the caller to decide on how to
>         handle the
>         fail.
>         
>         In the case above it is questionable whether we continue the
>         prune but
>         then another thread could free() heap memory so we might still
>         be able
>         to make some useful progress.
> 
> A daemon shouldn't run out of memory. Generally speaking, it's an
> exceptional condition that justifies abnormal termination.

Don't think it being a daemon makes any difference?

I'm not entirely sure how this works but I thought that modified pages
are written to swap. If swap fills up I think alocs can fail even though
heap is available. If that is then fixed by external intervention the
alocs could then succeed. So, maybe termination isn't the right chioce
here. In any case it should be evident from the log that the situation
exists and the admin can decide what action to take. OTOH if heap is
really exhausted then termination probably is the right choice.

In any case I prefer to try and continue.

Ian


_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to