ext4: trim allocation requests to group size
authorJan Kara <jack@suse.cz>
Fri, 27 Jan 2017 19:34:30 +0000 (14:34 -0500)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 06:02:36 +0000 (08:02 +0200)
commit98f58e05231f835dfb09359e3b5e3a886fe8f189
tree8e0ca0cfe9b8476fc4fcfdc47d624d756172d412
parent77bd57e66e071d866323132e1250350d7c90159f
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: Willy Tarreau <w@1wt.eu>
fs/ext4/mballoc.c