Revision 37f13561de6039b3a916d1510086030d097dea0f authored by Eric Sandeen on 10 January 2013, 16:41:48 UTC, committed by Ben Myers on 16 January 2013, 22:08:55 UTC
Dave Jones hit this assert when doing a compile on recent git, with
CONFIG_XFS_DEBUG enabled:

XFS: Assertion failed: (char *)dup - (char *)hdr == be16_to_cpu(*xfs_dir2_data_unused_tag_p(dup)), file: fs/xfs/xfs_dir2_data.c, line: 828

Upon further digging, the tag found by xfs_dir2_data_unused_tag_p(dup)
contained "2" and not the proper offset, and I found that this value was
changed after the memmoves under "Use a stale leaf for our new entry."
in xfs_dir2_block_addname(), i.e.

                        memmove(&blp[mid + 1], &blp[mid],
                                (highstale - mid) * sizeof(*blp));

overwrote it.

What has happened is that the previous call to xfs_dir2_block_compact()
has rearranged things; it changes btp->count as well as the
blp array.  So after we make that call, we must recalculate the
proper pointer to the leaf entries by making another call to
xfs_dir2_block_leaf_p().

Dave provided a metadump image which led to a simple reproducer
(create a particular filename in the affected directory) and this
resolves the testcase as well as the bug on his live system.

Thanks also to dchinner for looking at this one with me.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Tested-by: Dave Jones <davej@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
1 parent ab7eac2
Raw File
Kconfig
config M68K
	bool
	default y
	select HAVE_IDE
	select HAVE_AOUT if MMU
	select HAVE_DEBUG_BUGVERBOSE
	select HAVE_GENERIC_HARDIRQS
	select GENERIC_IRQ_SHOW
	select GENERIC_ATOMIC64
	select HAVE_UID16
	select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
	select GENERIC_CPU_DEVICES
	select GENERIC_STRNCPY_FROM_USER if MMU
	select GENERIC_STRNLEN_USER if MMU
	select FPU if MMU
	select ARCH_WANT_IPC_PARSE_VERSION
	select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
	select HAVE_MOD_ARCH_SPECIFIC
	select MODULES_USE_ELF_REL
	select MODULES_USE_ELF_RELA

config RWSEM_GENERIC_SPINLOCK
	bool
	default y

config RWSEM_XCHGADD_ALGORITHM
	bool

config ARCH_HAS_ILOG2_U32
	bool

config ARCH_HAS_ILOG2_U64
	bool

config GENERIC_GPIO
	bool

config GENERIC_HWEIGHT
	bool
	default y

config GENERIC_CALIBRATE_DELAY
	bool
	default y

config GENERIC_CSUM
	bool

config TIME_LOW_RES
	bool
	default y

config NO_IOPORT
	def_bool y

config NO_DMA
	def_bool (MMU && SUN3) || (!MMU && !COLDFIRE)

config ZONE_DMA
	bool
	default y

config HZ
	int
	default 1000 if CLEOPATRA
	default 100

source "init/Kconfig"

source "kernel/Kconfig.freezer"

config MMU
	bool "MMU-based Paged Memory Management Support"
	default y
	select GENERIC_IOMAP
	help
	  Select if you want MMU-based virtualised addressing space
	  support by paged memory management. If unsure, say 'Y'.

config MMU_MOTOROLA
	bool

config MMU_COLDFIRE
	bool

config MMU_SUN3
	bool
	depends on MMU && !MMU_MOTOROLA && !MMU_COLDFIRE

menu "Platform setup"

source arch/m68k/Kconfig.cpu

source arch/m68k/Kconfig.machine

source arch/m68k/Kconfig.bus

endmenu

menu "Kernel Features"

if COLDFIRE
source "kernel/Kconfig.preempt"
endif

source "mm/Kconfig"

endmenu

menu "Executable file formats"

source "fs/Kconfig.binfmt"

endmenu

if !MMU
menu "Power management options"

config PM
	bool "Power Management support"
	help
	  Support processor power management modes

endmenu
endif

source "net/Kconfig"

source "drivers/Kconfig"

source "arch/m68k/Kconfig.devices"

source "fs/Kconfig"

source "arch/m68k/Kconfig.debug"

source "security/Kconfig"

source "crypto/Kconfig"

source "lib/Kconfig"
back to top