From 8aa36f3ef94c16c6bb6345447e430a4f1df07b82 Mon Sep 17 00:00:00 2001 From: Lachlan McIlroy Date: Sun, 5 May 2013 23:10:00 -0400 Subject: [PATCH] --- yaml --- r: 375580 b: refs/heads/master c: e6155736ad76b2070652745f9e54cdea3f0d8567 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/mballoc.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 9acd3f9b4c9b..795119bf14ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e30b5dca15dea86aa697f9d58ff646294fe80d3d +refs/heads/master: e6155736ad76b2070652745f9e54cdea3f0d8567 diff --git a/trunk/fs/ext4/mballoc.c b/trunk/fs/ext4/mballoc.c index a11ea4d6164c..39d30f12d98d 100644 --- a/trunk/fs/ext4/mballoc.c +++ b/trunk/fs/ext4/mballoc.c @@ -2105,7 +2105,11 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac) group = ac->ac_g_ex.fe_group; for (i = 0; i < ngroups; group++, i++) { - if (group == ngroups) + /* + * Artificially restricted ngroups for non-extent + * files makes group > ngroups possible on first loop. + */ + if (group >= ngroups) group = 0; /* This now checks without needing the buddy page */