aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorliubo <liubo2009@cn.fujitsu.com>2011-01-26 01:21:39 -0500
committerChris Mason <chris.mason@oracle.com>2011-01-28 16:40:36 -0500
commit6b82ce8d824bd46053e46a895876cde39d9026e4 (patch)
tree756e869f3fc9a7baa320ca671d0174c5430c091a /fs/btrfs/extent_io.c
parenteab49bec41136460b12ac0fbeceeb88386d538c7 (diff)
btrfs: fix uncheck memory allocation in btrfs_submit_compressed_read
btrfs_submit_compressed_read() is lack of memory allocation checks and corresponding error route. After this fix, if it comes to "no memory" case, errno will be returned to userland step by step, and tell users this operation cannot go on. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 8b8d3d99ae68..6411ed6ca449 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1865,7 +1865,7 @@ static int submit_one_bio(int rw, struct bio *bio, int mirror_num,
1865 bio_get(bio); 1865 bio_get(bio);
1866 1866
1867 if (tree->ops && tree->ops->submit_bio_hook) 1867 if (tree->ops && tree->ops->submit_bio_hook)
1868 tree->ops->submit_bio_hook(page->mapping->host, rw, bio, 1868 ret = tree->ops->submit_bio_hook(page->mapping->host, rw, bio,
1869 mirror_num, bio_flags, start); 1869 mirror_num, bio_flags, start);
1870 else 1870 else
1871 submit_bio(rw, bio); 1871 submit_bio(rw, bio);
@@ -2126,7 +2126,7 @@ int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
2126 ret = __extent_read_full_page(tree, page, get_extent, &bio, 0, 2126 ret = __extent_read_full_page(tree, page, get_extent, &bio, 0,
2127 &bio_flags); 2127 &bio_flags);
2128 if (bio) 2128 if (bio)
2129 submit_one_bio(READ, bio, 0, bio_flags); 2129 ret = submit_one_bio(READ, bio, 0, bio_flags);
2130 return ret; 2130 return ret;
2131} 2131}
2132 2132