[Top] [All Lists]

Re: [PATCH] fix filestreams on 32-bit boxes

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] fix filestreams on 32-bit boxes
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 24 Aug 2007 02:36:35 +0100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <46CE2A07.7080305@sandeen.net>
References: <46CE2A07.7080305@sandeen.net>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/
On Thu, Aug 23, 2007 at 07:44:55PM -0500, Eric Sandeen wrote:
> xfs_filestream_mount() sets up an mru cache with:
>         err = xfs_mru_cache_create(&mp->m_filestream, lifetime, grp_count,
>                              (xfs_mru_cache_free_func_t)xfs_fstrm_free_func);
> but that cast is causing problems...
> typedef void (*xfs_mru_cache_free_func_t)(unsigned long, void*);
> but:
> void xfs_fstrm_free_func( 
>         xfs_ino_t       ino,
>         fstrm_item_t    *item)
> so on a 32-bit box, it's casting (32, 32) args into (64, 32) and I assume 
> it's getting garbage for *item, which subsequently causes an explosion.
> With this change the filestreams xfsqa tests don't oops on my 32-bit box.

Please also kill that blody cast.  Function pointer casts are wonderful
for hiding bugs like the one you just fixed from compilers, but that's it.

<Prev in Thread] Current Thread [Next in Thread>