ext4: trim allocation requests to group size
authorJan Kara <jack@suse.cz>
Fri, 27 Jan 2017 19:34:30 +0000 (14:34 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 5 Jun 2017 20:13:45 +0000 (21:13 +0100)
commitf213db429b883a2d5403de0b1ce92fb7d7ee979e
tree807c7e01469f504a18230cab5d6aecd111f31137
parent56a3a61fe870d1975d25ef5be92ff44161ae6039
ext4: trim allocation requests to group size

commit cd648b8a8fd5071d232242d5ee7ee3c0815776af upstream.

If filesystem groups are artifically small (using parameter -g to
mkfs.ext4), ext4_mb_normalize_request() can result in a request that is
larger than a block group. Trim the request size to not confuse
allocation code.

Reported-by: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/mballoc.c