From c7e293251fa28aebb201a884c074f0b36cbacc20 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 15 Dec 2012 22:32:23 -0500 Subject: [PATCH] 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" --- e2fsck/pass5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 1.8.3.1