From mboxrd@z Thu Jan 1 00:00:00 1970 From: matthew.khouzam@ericsson.com (Matthew Khouzam) Date: Wed, 3 Nov 2010 14:25:10 -0400 Subject: [ltt-dev] [PATCH RFC] Seek fix Message-ID: <4CD1A906.4000307@ericsson.com> Message-ID: <20101103182510.tk3AtiDUIp7AzSOwhrMeDgsYtJ5WZyieb8VId6-6PqM@z> I am including an example to better illustrace my fix. the current binary search has a case where high can be lower then low. An example: 51 blocks, the element is somewhere in the 12th block. trace of before : low : 0, high 51 , block_num -1 low : 0, high 24 , block_num 25 low : 13, high 24 , block_num 12 low : 13, high 17 , block_num 18 low : 13, high 14 , block_num 15 low : 13, high 12 , block_num 13 This will assert and fail. The trace after will produce the following walkthrough low : 0, high 51 , block_num -1 low : 0, high 24 , block_num 25 low : 0, high 24 , block_num 12 Found! -------------- next part -------------- A non-text attachment was scrubbed... Name: seek_fix.patch Type: text/x-patch Size: 757 bytes Desc: not available URL: