lkml.org 
[lkml]   [1999]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.3.14: bug-fix for raw IO error recovery


On Thu, 19 Aug 1999, Andrea Arcangeli wrote:
>
> Wouldn't be possible to let get_page_map to give us back more information
> by returning -1 if the page_map is not good?

Don't do this. It leads to all kinds of problems for 64-bit architectures,
I'm not at all sure that casting (int) -1 to a pointer is at all safe. I
would not be surprised if it is entirely legal and expected on some
architectures for it to become 0x00000000ffffffff, which might be a
perfectly valid pointer.

If you play error games with pointers, there's just two ways to do it
nicely: either the NULL pointer (right now) or by having a nicely
abstracted thing that can be extended to do different things on different
architectures (this is what the "dcache" error pointers are doing with the
ERR_PTR/PTR_ERR/IS_ERR stuff - right now all architectures have pointers
that look roughly the same and there is just one global definition for
ERR_PTR, but if some strange architecture comes along some day we'll be
able to handle it cleanly).

In the meantime, things like this are _definitely_ a bad idea.

Linus


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

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.077 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site