Skip to content

Commit

Permalink
ktest: Fix off-by-one in config bisect result
Browse files Browse the repository at this point in the history
Because in perl the array size returned by $#arr, is the last
index and not the actually size of the array, we end the config
bisect early, thinking there is only one config left when there
are in fact two. Thus the result has a 50% chance of picking
the correct config that caused the problem.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jun 2, 2011
1 parent 55922c9 commit 4c8cc55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ sub run_config_bisect {
if (!$found) {
# try the other half
doprint "Top half produced no set configs, trying bottom half\n";
@tophalf = @start_list[$half .. $#start_list];
@tophalf = @start_list[$half + 1 .. $#start_list];
create_config @tophalf;
read_current_config \%current_config;
foreach my $config (@tophalf) {
Expand Down Expand Up @@ -1690,7 +1690,7 @@ sub run_config_bisect {
# remove half the configs we are looking at and see if
# they are good.
$half = int($#start_list / 2);
} while ($half > 0);
} while ($#start_list > 0);

# we found a single config, try it again unless we are running manually

Expand Down

0 comments on commit 4c8cc55

Please sign in to comment.