[Btrfs-devel] In correct usage of IS_ERR() in extent_io.c

Chris Mason chris.mason at oracle.com
Mon Mar 17 06:03:24 PDT 2008


On Saturday 15 March 2008, Peter Teoh wrote:
> Please correct me if wrong.   kmem_cache_alloc() based API should not
> call IS_ERR() to check on error.   Similarly, many usage of IS_ERR()
> is not correct, as it will lead to returning an error condition when
> there is no error.   Self-explanatory as in the following err.h header
> declaration:
>
> #define MAX_ERRNO       4095
>
> #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)

We won't be getting pointers > than an unsigned(-4095), but the patch is still 
correct.  I don't need the IS_ERRs.

-chris



More information about the Btrfs-devel mailing list