lkml.org 
[lkml]   [2012]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [Patch 3/4] ipc/mqueue: strengthen checks on mqueue creation
    >> But ENOMEM is more inaccurate. It almostly is used for kmalloc failure.
    >
    > I chose ENOMEM for that particular error because above there we have
    > checked the passed in arguments to make sure that they don't violate our
    > allowances for max message or max message size.  If we violate either of
    > those items, we return EINVAL.  In this case, neither of the values is
    > invalid, it's just that together they make an overly large allocation.
    > I would see that as more helpful to a programmer than EINVAL when the
    > values are within the maximums allowed.  At least with ENOMEM the
    > programmer knows they have to reduce their combined message size and
    > message count in order to get things working.

    Incorrect. When ENOMEM is returned, programmers can't know
    which problem was happen 1) kernel has real memory starvation
    or 2) queue limitation exceed was happen. The problem is, you
    introduced new overloaded error code for avoiding overload error code.
    It doesn't make sense. My question was, why can't you choose no
    overload error code if you want accurate one?
    --
    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/

    \
     
     \ /
      Last update: 2012-05-01 23:01    [W:4.618 / U:0.224 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site