Message ID | 1402425989-25628-1-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 18e1871..8ccbe9a 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -521,6 +521,10 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, if (unlikely(map->m_len > INT_MAX)) map->m_len = INT_MAX; + /* We can handle the block number less than EXT_MAX_BLOCKS */ + if (unlikely(map->m_lblk >= EXT_MAX_BLOCKS)) + return -EIO; + /* Lookup extent status tree firstly */ if (ext4_es_lookup_extent(inode, map->m_lblk, &es)) { ext4_es_lru_add(inode);