Skip to content

Commit

Permalink
Btrfs: fix extent state leak on failed nodatasum reads
Browse files Browse the repository at this point in the history
When encountering an EIO while reading from a nodatasum extent, we
insert an error record into the inode's failure tree.
btrfs_readpage_end_io_hook returns early for nodatasum inodes. We'd
better clear the failure tree in that case, otherwise the kernel
complains about

	BUG extent_state: Objects remaining on kmem_cache_close()

on rmmod.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Jan Schmidt authored and Chris Mason committed Jun 10, 2011
1 parent 0e73587 commit 08d2f34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
}

if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)
return 0;
goto good;

if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID &&
test_range_bit(io_tree, start, end, EXTENT_NODATASUM, 1, NULL)) {
Expand Down

0 comments on commit 08d2f34

Please sign in to comment.