1 ext4: return ENOMEM rather than EIO when find_###_page() fails
3 From: Younger Liu <younger.liucn@gmail.com>
5 Return ENOMEM rather than EIO when find_get_page() fails in
6 ext4_mb_get_buddy_page_lock() and find_or_create_page() fails in
9 Signed-off-by: Younger Liu <younger.liucn@gmail.com>
10 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 fs/ext4/mballoc.c | 16 ++++++++++++----
13 1 file changed, 12 insertions(+), 4 deletions(-)
15 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
16 index a888cac..73ccbb3 100644
17 --- a/fs/ext4/mballoc.c
18 +++ b/fs/ext4/mballoc.c
19 @@ -989,7 +989,7 @@ static int ext4_mb_get_buddy_page_lock(struct super_block *sb,
20 poff = block % blocks_per_page;
21 page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS);
25 BUG_ON(page->mapping != inode->i_mapping);
26 e4b->bd_bitmap_page = page;
27 e4b->bd_bitmap = page_address(page) + (poff * sb->s_blocksize);
28 @@ -1003,7 +1003,7 @@ static int ext4_mb_get_buddy_page_lock(struct super_block *sb,
29 pnum = block / blocks_per_page;
30 page = find_or_create_page(inode->i_mapping, pnum, GFP_NOFS);
34 BUG_ON(page->mapping != inode->i_mapping);
35 e4b->bd_buddy_page = page;
37 @@ -1168,7 +1168,11 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group,
41 - if (page == NULL || !PageUptodate(page)) {
46 + if (!PageUptodate(page)) {
50 @@ -1197,7 +1201,11 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group,
54 - if (page == NULL || !PageUptodate(page)) {
59 + if (!PageUptodate(page)) {
67 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
68 the body of a message to majordomo@vger.kernel.org
69 More majordomo info at http://vger.kernel.org/majordomo-info.html