[ofa-general] Re: Question about mthca_alloc_memfree and mthca_alloc_db

Ira Weiny weiny2 at llnl.gov
Thu Oct 4 16:06:43 PDT 2007


On Thu, 04 Oct 2007 15:35:13 -0700
Roland Dreier <rdreier at cisco.com> wrote:

>  > We hit a bug in the RHEL4 kernel which was fixed in your latest tree.  The bug
>  > was in mthca_alloc_memfree.  When comparing your code to the current RH kernel,
>  > we wondered why you would not return the error code from mthca_alloc_db rather
>  > than -ENOMEM as demonstrated in the patch below?
> 
> Does Red Hat know about the bug so they can fix it in an update?

Yes I emailed Doug and our contractor here with a patch which uses the return
values from mthca_alloc_db.

> 
> Anyway, I don't think the return value matters much -- I think when I
> wrote the code, I just figured that the allocation failed so it makes
> sense to return ENOMEM rather than whatever internal reason caused the
> allocation to fail.  Does it make any practical difference one way or
> another?
> 

Only because a ULP could print the return code and one could get a better idea
of what the error was.  (Lustre does this.)  Since mthca_alloc_db returns
EINVAL as well as ENOMEM it seems wasteful to ignore that.

Thanks,
Ira



More information about the general mailing list