From: Josef Bacik Date: Fri, 20 Sep 2013 17:51:31 +0000 (-0400) Subject: Btrfs-progs: fix the min ticks check in print_seek_histogram X-Git-Tag: upstream/4.16.1~3106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b10eaa8e1d453d65f571db47cd2207041835451;p=platform%2Fupstream%2Fbtrfs-progs.git Btrfs-progs: fix the min ticks check in print_seek_histogram Before I had been dividing by 5 but that gave me too much output so I changed it to 20 without changing the min seeks test. Fix this to avoid a divide by 0 problem. Thanks, Signed-off-by: Josef Bacik Signed-off-by: David Sterba Signed-off-by: Chris Mason --- diff --git a/btrfs-calc-size.c b/btrfs-calc-size.c index 7ae728e..e9ef37f 100644 --- a/btrfs-calc-size.c +++ b/btrfs-calc-size.c @@ -228,7 +228,7 @@ static void print_seek_histogram(struct root_stats *stat) u64 max_seek = stat->max_seek_len; int digits = 1; - if (stat->total_seeks < 5) + if (stat->total_seeks < 20) return; while ((max_seek /= 10))