aboutsummaryrefslogtreecommitdiff
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-03-20 12:03:13 +0800
committerAlex Shi <alex.shi@linaro.org>2017-03-20 12:03:13 +0800
commit89e7fad96be88f30f491bf227d864bf5e8e701b2 (patch)
tree6316161ebd26b780991ff8632471fbbfa3af7ea8 /fs/ext4/mballoc.c
parent5b0250d2571ee75ca3c0b34579c3e90bc2bd9c6a (diff)
parent1c563c0006661025d7a6c9bc85fc889a4e8a1c06 (diff)
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index b7a3957a9dca..84cd77663e1f 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3120,6 +3120,13 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
if (ar->pright && start + size - 1 >= ar->lright)
size -= start + size - ar->lright;
+ /*
+ * Trim allocation request for filesystems with artificially small
+ * groups.
+ */
+ if (size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb))
+ size = EXT4_BLOCKS_PER_GROUP(ac->ac_sb);
+
end = start + size;
/* check we don't cross already preallocated blocks */