public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] fix filestreams on 32-bit boxes
Date: Fri, 24 Aug 2007 11:48:20 +1000	[thread overview]
Message-ID: <20070824014820.GF72985246@sgi.com> (raw)
In-Reply-To: <46CE2A07.7080305@sandeen.net>

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.
> 
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> 
> Index: linux-2.6.22.i386/fs/xfs/xfs_filestream.c
> ===================================================================
> --- linux-2.6.22.i386.orig/fs/xfs/xfs_filestream.c
> +++ linux-2.6.22.i386/fs/xfs/xfs_filestream.c
> @@ -350,7 +350,7 @@ _xfs_filestream_update_ag(
>  /* xfs_fstrm_free_func(): callback for freeing cached stream items. */
>  void
>  xfs_fstrm_free_func(
> -	xfs_ino_t	ino,
> +	unsigned long	ino,
>  	fstrm_item_t	*item)
>  {
>  	xfs_inode_t	*ip = item->ip;

hmmm - probably should make xfs_fstrm_free_func follow the correct prototype
and convert the item into an opaque void * as well. Then we can remove the
cast that hid this problem in xfs_filestream_mount()....

Nice catch, though, Eric.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  parent reply	other threads:[~2007-08-24  1:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-24  0:44 [PATCH] fix filestreams on 32-bit boxes Eric Sandeen
2007-08-24  1:36 ` Christoph Hellwig
2007-08-24  1:48 ` David Chinner [this message]
2007-08-24  2:03   ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070824014820.GF72985246@sgi.com \
    --to=dgc@sgi.com \
    --cc=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox