On Fri, 24 Jun 2011, Robin Dong wrote: > 2011/6/24 Yongqiang Yang <xiaoqiangnk@xxxxxxxxx>: > > On Thu, Jun 23, 2011 at 10:57 PM, Eric Sandeen <sandeen@xxxxxxxxxx> wrote: > >> On 6/23/11 3:47 AM, Robin Dong wrote: > >>> 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. > >> > >> Do you have any testcase you can share which shows this bug? > > I am not sure if Robin has any test case. > > > > According to code, I think there is no bug case. Because this > > function is called by ext4_ext_split() and ext4_ext_split() is called > > only if the index block has free space. > > > > I think the right logic should be as this patch shows, that is, we > > should lookup the capacity before insertion. > > Exactly! :-) Hi Robin, this is the reason why I asked you to provide better commit description with better reasoning for this change. Since it is not immediately clear from the patch itself why you did the change, it saves time for everyone (just FYI for the next time:). Thanks! -Lukas