linux/fs/btrfs
Gui Hecheng 3c9665df0c btrfs: fix warning while merging two adjacent extents
When we have two adjacent extents in relink_extent_backref,
we try to merge them. When we use btrfs_search_slot to locate the
slot for the current extent, we shouldn't set "ins_len = 1",
because we will merge it into the previous extent rather than
insert a new item. Otherwise, we may happen to create a new leaf
in btrfs_search_slot and path->slot[0] will be 0. Then we try to
fetch the previous item using "path->slots[0]--", and it will cause
a warning as follows:

	[  145.713385] WARNING: CPU: 3 PID: 1796 at fs/btrfs/extent_io.c:5043 map_private_extent_buffer+0xd4/0xe0
	[  145.713387] btrfs bad mapping eb start 5337088 len 4096, wanted 167772306 8
	...
	[  145.713462]  [<ffffffffa034b1f4>] map_private_extent_buffer+0xd4/0xe0
	[  145.713476]  [<ffffffffa030097a>] ? btrfs_free_path+0x2a/0x40
	[  145.713485]  [<ffffffffa0340864>] btrfs_get_token_64+0x64/0xf0
	[  145.713498]  [<ffffffffa033472c>] relink_extent_backref+0x41c/0x820
	[  145.713508]  [<ffffffffa0334d69>] btrfs_finish_ordered_io+0x239/0xa80

I encounter this warning when running defrag having mkfs.btrfs
with option -M. At the same time there are read/writes & snapshots
running at background.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
2014-01-29 07:06:22 -08:00
..
tests
acl.c
async-thread.c
async-thread.h
backref.c Btrfs: only process as many file extents as there are refs 2014-01-28 13:20:28 -08:00
backref.h
btrfs_inode.h Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
check-integrity.c
check-integrity.h
compression.c
compression.h
ctree.c Btrfs: fix to search previous metadata extent item since skinny metadata 2014-01-28 13:20:33 -08:00
ctree.h Btrfs: change the members' order of btrfs_space_info structure to reduce the cache miss 2014-01-28 13:20:38 -08:00
delayed-inode.c
delayed-inode.h
delayed-ref.c Btrfs: attach delayed ref updates to delayed ref heads 2014-01-28 13:20:25 -08:00
delayed-ref.h Btrfs: attach delayed ref updates to delayed ref heads 2014-01-28 13:20:25 -08:00
dev-replace.c
dev-replace.h
dir-item.c
disk-io.c btrfs: undo sysfs when open_ctree() fails 2014-01-28 13:20:44 -08:00
disk-io.h
export.c
export.h
extent_io.c
extent_io.h
extent_map.c
extent_map.h
extent-tree.c Btrfs: fix wrong block group in trace during the free space allocation 2014-01-28 13:20:40 -08:00
file-item.c
file.c Btrfs: fix the race between write back and nocow buffered write 2014-01-28 13:20:28 -08:00
free-space-cache.c
free-space-cache.h
hash.c Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
hash.h Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
inode-item.c
inode-map.c
inode-map.h
inode.c btrfs: fix warning while merging two adjacent extents 2014-01-29 07:06:22 -08:00
ioctl.c btrfs: fix defrag 32-bit integer overflow 2014-01-28 13:20:43 -08:00
Kconfig Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
locking.c
locking.h
lzo.c
Makefile Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
math.h
ordered-data.c
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
props.h Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
qgroup.c Btrfs: fix qgroup rescan to work with skinny metadata 2014-01-28 13:20:27 -08:00
raid56.c
raid56.h
rcu-string.h
reada.c
relocation.c Btrfs: fix an oops when we fail to relocate tree blocks 2014-01-28 13:20:14 -08:00
root-tree.c
scrub.c Btrfs: fix to search previous metadata extent item since skinny metadata 2014-01-28 13:20:33 -08:00
send.c Btrfs: fix infinite path build loops in incremental send 2014-01-29 07:06:22 -08:00
send.h
struct-funcs.c
super.c btrfs: Cleanup the btrfs_parse_options for remount. 2014-01-28 13:20:34 -08:00
sysfs.c btrfs: sysfs: list the NO_HOLES feature 2014-01-28 13:20:42 -08:00
sysfs.h
transaction.c btrfs: Add noinode_cache mount option 2014-01-28 13:20:33 -08:00
transaction.h Btrfs: make fsync latency less sucky 2014-01-28 13:20:25 -08:00
tree-defrag.c
tree-log.c Btrfs: flush the dirty pages of the ordered extent aggressively during logging csum 2014-01-28 13:20:37 -08:00
tree-log.h
ulist.c Btrfs: optimize to remove unnecessary removal with ulist reallocation 2014-01-28 13:20:30 -08:00
ulist.h
uuid-tree.c
volumes.c
volumes.h
xattr.c Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
xattr.h
zlib.c