diff --git a/[refs] b/[refs] index 4d843a231466..3b2242e7ddc6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bd2d0210cf22f2bd0cef72eb97cf94fc7d31d8cc +refs/heads/master: 877836905da55e8f2426234f42a89287184949e9 diff --git a/trunk/fs/ext4/inode.c b/trunk/fs/ext4/inode.c index 58604fe11f4f..077c3c9c432e 100644 --- a/trunk/fs/ext4/inode.c +++ b/trunk/fs/ext4/inode.c @@ -761,6 +761,11 @@ static int ext4_alloc_branch(handle_t *handle, struct inode *inode, * parent to disk. */ bh = sb_getblk(inode->i_sb, new_blocks[n-1]); + if (unlikely(!bh)) { + err = -EIO; + goto failed; + } + branch[n].bh = bh; lock_buffer(bh); BUFFER_TRACE(bh, "call get_create_access"); diff --git a/trunk/fs/ext4/mballoc.c b/trunk/fs/ext4/mballoc.c index d732ef5a835d..611c866ef3fe 100644 --- a/trunk/fs/ext4/mballoc.c +++ b/trunk/fs/ext4/mballoc.c @@ -4537,6 +4537,8 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, if (!bh) tbh = sb_find_get_block(inode->i_sb, block + i); + if (unlikely(!tbh)) + continue; ext4_forget(handle, flags & EXT4_FREE_BLOCKS_METADATA, inode, tbh, block + i); }