Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcc7b445 authored by Eric Sandeen's avatar Eric Sandeen Committed by Tim Shimmin
Browse files

[XFS] fix filestreams on 32-bit boxes



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.

SGI-PV: 967795
SGI-Modid: xfs-linux-melb:xfs-kern:29510a

Signed-off-by: default avatarEric Sandeen <sandeen@sandeen.net>
Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent b394e43e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -350,9 +350,10 @@ _xfs_filestream_update_ag(
/* xfs_fstrm_free_func(): callback for freeing cached stream items. */
void
xfs_fstrm_free_func(
	xfs_ino_t	ino,
	fstrm_item_t	*item)
	unsigned long	ino,
	void		*data)
{
	fstrm_item_t	*item  = (fstrm_item_t *)data;
	xfs_inode_t	*ip = item->ip;
	int ref;

@@ -438,7 +439,7 @@ xfs_filestream_mount(
	grp_count = 10;

	err = xfs_mru_cache_create(&mp->m_filestream, lifetime, grp_count,
	                     (xfs_mru_cache_free_func_t)xfs_fstrm_free_func);
	                     xfs_fstrm_free_func);

	return err;
}