Message ID | 1369047116-9378-100-git-send-email-luis.henriques@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 9777e2f..4986dd3 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1980,7 +1980,11 @@ repeat: 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 */