From ecde2e30033219b8b2e777bd8618253d4613346f Mon Sep 17 00:00:00 2001 From: Tsutomu Itoh Date: Thu, 16 Feb 2012 16:23:58 +0900 Subject: [PATCH] --- yaml --- r: 287894 b: refs/heads/master c: 285190d99fef696ec8b0041787387f013cb71d67 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/compression.c | 2 ++ trunk/fs/btrfs/extent_io.c | 2 +- trunk/fs/btrfs/volumes.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 539885c957ac..a6b4ce76447a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 600a45e1d5e376f679ff9ecc4ce9452710a6d27c +refs/heads/master: 285190d99fef696ec8b0041787387f013cb71d67 diff --git a/trunk/fs/btrfs/compression.c b/trunk/fs/btrfs/compression.c index 14f1c5a0b2d2..d02c27cd14c7 100644 --- a/trunk/fs/btrfs/compression.c +++ b/trunk/fs/btrfs/compression.c @@ -588,6 +588,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, page_offset(bio->bi_io_vec->bv_page), PAGE_CACHE_SIZE); read_unlock(&em_tree->lock); + if (!em) + return -EIO; compressed_len = em->block_len; cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); diff --git a/trunk/fs/btrfs/extent_io.c b/trunk/fs/btrfs/extent_io.c index b05d35a7c0f1..8d6f55fbd28e 100644 --- a/trunk/fs/btrfs/extent_io.c +++ b/trunk/fs/btrfs/extent_io.c @@ -3308,7 +3308,7 @@ int try_release_extent_mapping(struct extent_map_tree *map, len = end - start + 1; write_lock(&map->lock); em = lookup_extent_mapping(map, start, len); - if (IS_ERR_OR_NULL(em)) { + if (!em) { write_unlock(&map->lock); break; } diff --git a/trunk/fs/btrfs/volumes.c b/trunk/fs/btrfs/volumes.c index d8f282b5baa9..cd040bf3fd87 100644 --- a/trunk/fs/btrfs/volumes.c +++ b/trunk/fs/btrfs/volumes.c @@ -1954,7 +1954,7 @@ static int btrfs_relocate_chunk(struct btrfs_root *root, em = lookup_extent_mapping(em_tree, chunk_offset, 1); read_unlock(&em_tree->lock); - BUG_ON(em->start > chunk_offset || + BUG_ON(!em || em->start > chunk_offset || em->start + em->len < chunk_offset); map = (struct map_lookup *)em->bdev;