xfs
[Top] [All Lists]

[PATCH] fix filestreams on 32-bit boxes

To: xfs@xxxxxxxxxxx
Subject: [PATCH] fix filestreams on 32-bit boxes
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 23 Aug 2007 19:44:55 -0500
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 1.5.0.12 (X11/20070530)
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@xxxxxxxxxxx>

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;


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