Re: [PATCH] 2.4.9-ac10 but not only, locks_alloc_lock()

Manfred Spraul (manfred@colorfullife.com)
Sun, 9 Sep 2001 11:25:15 +0200


> Not sure about one thing, though: what error code to return for
> locks_mandatory_area() on failure. It's invoked from some of the
> {do,sys}_*{read,write}*() routines and nowhere else AFAICT. I set it
to
> -ENOMEM, maybe this is not the right thing to do.

I'd put the file_lock structure on the stack. It's ~ 90 bytes long, not
too large.
Returning -ENOMEM is imho not acceptable: -ENOMEM is not listed in
SusV2, and locks_alloc_lock() internally checks for rlimits (setting
RLIM_NLIMITS to 0 and execing another app might have dangerous
sideeffects).

--
    Manfred

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/