|
@@ -779,6 +779,11 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
|
|
|
ix = curp->p_idx;
|
|
|
}
|
|
|
|
|
|
+ if (unlikely(ix > EXT_MAX_INDEX(curp->p_hdr))) {
|
|
|
+ EXT4_ERROR_INODE(inode, "ix > EXT_MAX_INDEX!");
|
|
|
+ return -EIO;
|
|
|
+ }
|
|
|
+
|
|
|
ix->ei_block = cpu_to_le32(logical);
|
|
|
ext4_idx_store_pblock(ix, ptr);
|
|
|
le16_add_cpu(&curp->p_hdr->eh_entries, 1);
|