[XFS] 956618: Linux crashes on boot with XFS-DMAPI filesystem when CONFIG_XFS_TRACE is on

SGI-PV: 956618
SGI-Modid: xfs-linux-melb:xfs-kern:27196a

Signed-off-by: Vlad Apostolov <vapo@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>

authored by Vlad Apostolov and committed by Tim Shimmin 93c189c1 088406bc

+27 -21
+1 -16
fs/xfs/Makefile-linux-2.6
··· 21 21 XFS_LINUX := linux-2.6 22 22 23 23 ifeq ($(CONFIG_XFS_DEBUG),y) 24 - EXTRA_CFLAGS += -g -DSTATIC="" -DDEBUG 25 - EXTRA_CFLAGS += -DXFS_BUF_LOCK_TRACKING 26 - endif 27 - ifeq ($(CONFIG_XFS_TRACE),y) 28 - EXTRA_CFLAGS += -DXFS_ALLOC_TRACE 29 - EXTRA_CFLAGS += -DXFS_ATTR_TRACE 30 - EXTRA_CFLAGS += -DXFS_BLI_TRACE 31 - EXTRA_CFLAGS += -DXFS_BMAP_TRACE 32 - EXTRA_CFLAGS += -DXFS_BMBT_TRACE 33 - EXTRA_CFLAGS += -DXFS_DIR2_TRACE 34 - EXTRA_CFLAGS += -DXFS_DQUOT_TRACE 35 - EXTRA_CFLAGS += -DXFS_ILOCK_TRACE 36 - EXTRA_CFLAGS += -DXFS_LOG_TRACE 37 - EXTRA_CFLAGS += -DXFS_RW_TRACE 38 - EXTRA_CFLAGS += -DXFS_BUF_TRACE 39 - EXTRA_CFLAGS += -DXFS_VNODE_TRACE 24 + EXTRA_CFLAGS += -g 40 25 endif 41 26 42 27 obj-$(CONFIG_XFS_FS) += xfs.o
+2 -2
fs/xfs/linux-2.6/xfs_buf.c
··· 15 15 * along with this program; if not, write the Free Software Foundation, 16 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 17 */ 18 + #include "xfs.h" 18 19 #include <linux/stddef.h> 19 20 #include <linux/errno.h> 20 21 #include <linux/slab.h> ··· 32 31 #include <linux/kthread.h> 33 32 #include <linux/migrate.h> 34 33 #include <linux/backing-dev.h> 35 - #include "xfs_linux.h" 36 34 37 35 STATIC kmem_zone_t *xfs_buf_zone; 38 36 STATIC kmem_shaker_t xfs_buf_shake; ··· 1406 1406 btp->bt_hashshift = external ? 3 : 8; /* 8 or 256 buckets */ 1407 1407 btp->bt_hashmask = (1 << btp->bt_hashshift) - 1; 1408 1408 btp->bt_hash = kmem_zalloc((1 << btp->bt_hashshift) * 1409 - sizeof(xfs_bufhash_t), KM_SLEEP); 1409 + sizeof(xfs_bufhash_t), KM_SLEEP | KM_LARGE); 1410 1410 for (i = 0; i < (1 << btp->bt_hashshift); i++) { 1411 1411 spin_lock_init(&btp->bt_hash[i].bh_lock); 1412 1412 INIT_LIST_HEAD(&btp->bt_hash[i].bh_list);
+1 -3
fs/xfs/support/debug.c
··· 15 15 * along with this program; if not, write the Free Software Foundation, 16 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 17 */ 18 + #include <xfs.h> 18 19 #include "debug.h" 19 20 #include "spin.h" 20 - #include <asm/page.h> 21 - #include <linux/sched.h> 22 - #include <linux/kernel.h> 23 21 24 22 static char message[256]; /* keep it off the stack */ 25 23 static DEFINE_SPINLOCK(xfs_err_lock);
+23
fs/xfs/xfs.h
··· 17 17 */ 18 18 #ifndef __XFS_H__ 19 19 #define __XFS_H__ 20 + 21 + #ifdef CONFIG_XFS_DEBUG 22 + #define STATIC 23 + #define DEBUG 1 24 + #define XFS_BUF_LOCK_TRACKING 1 25 + /* #define QUOTADEBUG 1 */ 26 + #endif 27 + 28 + #ifdef CONFIG_XFS_TRACE 29 + #define XFS_ALLOC_TRACE 1 30 + #define XFS_ATTR_TRACE 1 31 + #define XFS_BLI_TRACE 1 32 + #define XFS_BMAP_TRACE 1 33 + #define XFS_BMBT_TRACE 1 34 + #define XFS_DIR2_TRACE 1 35 + #define XFS_DQUOT_TRACE 1 36 + #define XFS_ILOCK_TRACE 1 37 + #define XFS_LOG_TRACE 1 38 + #define XFS_RW_TRACE 1 39 + #define XFS_BUF_TRACE 1 40 + #define XFS_VNODE_TRACE 1 41 + #endif 42 + 20 43 #include <linux-2.6/xfs_linux.h> 21 44 #endif /* __XFS_H__ */