On Thu, 4 Jan 2007, Eric Sandeen wrote: > Andrew Morton wrote: > > > btw, couldn't we fix this bug with a simple old > > > > --- a/fs/bad_inode.c~a > > +++ a/fs/bad_inode.c > > @@ -15,7 +15,7 @@ > > #include <linux/smp_lock.h> > > #include <linux/namei.h> > > > > -static int return_EIO(void) > > +static long return_EIO(void) > > { > > return -EIO; > > } > > _ > > > > ? > > What about ops that return loff_t (64 bits) on 32-bit arches and stuff > it into 2 registers.... Do we actually have cases where we cast to a different return value? I'll happily cast away arguments that aren't used, but I'm not sure that we ever should cast different return values (not "int" vs "long", but also not "loff_t" etc). On 32-bit architectures, 64-bit entities may be returned totally different ways (ie things like "caller allocates space for them and passes in a magic pointer to the return value as the first _real_ argument"). So with my previous email, I was definitely _not_ trying to say that casting function pointers is ok. In practice it is ok when the _arguments_ differ, but not necessarily when the _return-type_ differs. I was cc'd into the discussion late, so I didn't realize that we apparently already have a situation where changing the return value to "long" might make a difference. If so, I agree that we shouldn't do this at all (although Andrew's change to "long" seems perfectly fine as a "make old cases continue to work" patch if it actually matters). Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- References:
- [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Eric Sandeen <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Andrew Morton <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Eric Sandeen <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Andrew Morton <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Eric Sandeen <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Andrew Morton <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Linus Torvalds <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Al Viro <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Linus Torvalds <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Al Viro <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Andrew Morton <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Eric Sandeen <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Andrew Morton <[email protected]>
- Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- From: Eric Sandeen <[email protected]>
- [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- Prev by Date: Re: sonypc with Sony Vaio VGN-SZ1VP
- Next by Date: Re: [openib-general] [PATCH v4 01/13] Linux RDMA Core Changes
- Previous by thread: Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- Next by thread: Re: [UPDATED PATCH] fix memory corruption from misinterpreted bad_inode_ops return values
- Index(es):