]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: avoid eh_entries overflow before insert extent_idx
authorRobin Dong <hao.bigrat@gmail.com>
Mon, 18 Jul 2011 03:43:42 +0000 (23:43 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 18 Jul 2011 03:43:42 +0000 (23:43 -0400)
commit69808d534bc5298b72d65bbb1fb6f2e696404e4c
tree8bcbe5545066606b12d6cd250747471802520c0b
parent3278a5ecde00a95965cecd105e231fe052826622
ext4: avoid eh_entries overflow before insert extent_idx

If eh_entries is equal to (or greater than) eh_max, the operation of
inserting new extent_idx will make number of entries overflow.
So check eh_entries before inserting the new extent_idx.

Although there is no bug case according the code (function
ext4_ext_insert_index is called by ext4_ext_split and ext4_ext_split
is called only if the index block has free space), the right logic
should be "lookup the capacity before insertion".

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c