From: Theodore Ts'o Date: Sun, 16 Dec 2012 03:32:23 +0000 (-0500) Subject: e2fsck: fix pass5 optimization for bigalloc file systems X-Git-Tag: v1.42.7~79 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c7e293251fa28aebb201a884c074f0b36cbacc20;p=tools%2Fe2fsprogs.git e2fsck: fix pass5 optimization for bigalloc file systems Commit 53e3120c18 introduced a regression which would case e2fsck to overrun an array boundary for bigalloc file systems, and most likely crash. Fix this by correctly using blocks instead of clusters when incrementing the loop counter in the fast path optimization case. Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c index 5aff55c..fce0f6e 100644 --- a/e2fsck/pass5.c +++ b/e2fsck/pass5.c @@ -306,7 +306,7 @@ redo_counts: n = ext2fs_bitcount(actual_buf, nbytes); group_free = fs->super->s_clusters_per_group - n; free_blocks += group_free; - i += fs->super->s_clusters_per_group - 1; + i += EXT2FS_C2B(fs, fs->super->s_clusters_per_group - 1); goto next_group; no_optimize: