Jan Kara 64847df5bf ext2: Fix underflow in ext2_max_size()
commit 1c2d14212b15a60300a2d4f6364753e87394c521 upstream.

When ext2 filesystem is created with 64k block size, ext2_max_size()
will return value less than 0. Also, we cannot write any file in this fs
since the sb->maxbytes is less than 0. The core of the problem is that
the size of block index tree for such large block size is more than
i_blocks can carry. So fix the computation to count with this
possibility.

File size limits computed with the new function for the full range of
possible block sizes look like:

bits file_size
10     17247252480
11    275415851008
12   2196873666560
13   2197948973056
14   2198486220800
15   2198754754560
16   2198888906752

CC: stable@vger.kernel.org
Reported-by: yangerkun <yangerkun@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 08:44:36 +01:00
..
2017-12-20 10:04:56 +01:00
2018-12-17 21:55:12 +01:00
2017-11-30 08:37:20 +00:00
2019-03-23 08:44:21 +01:00
2018-09-15 09:40:41 +02:00
2019-02-20 10:13:09 +01:00
2018-12-21 14:09:50 +01:00
2015-11-10 12:07:22 -08:00
2017-06-14 13:16:24 +02:00
2015-11-16 23:54:45 -08:00
2018-05-16 10:06:51 +02:00
2015-11-16 23:54:45 -08:00
2017-06-14 13:16:24 +02:00
2018-02-16 20:09:43 +01:00
2017-06-14 13:16:24 +02:00
2018-09-09 20:04:36 +02:00