Files
linux/fs
Jan Kara 4b49ea5699 ext2: Fix underflow in ext2_max_size()
commit 1c2d14212b 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>
2023-05-15 12:06:08 +09:00
..
2018-05-30 13:19:56 +02:00
2016-05-20 17:58:30 -07:00
2023-05-15 08:58:11 +09:00
2023-05-15 10:31:48 +09:00
2017-11-30 08:39:04 +00:00
2023-05-15 11:49:44 +09:00
2023-05-15 11:22:51 +09:00
2023-05-15 10:36:26 +09:00
2016-09-27 21:20:53 -04:00
2017-07-05 16:18:14 +02:00
2023-05-15 11:50:09 +09:00
2016-09-27 18:47:38 -04:00
2018-05-16 11:39:34 +02:00
2017-09-20 09:59:51 +02:00
2017-09-26 00:32:37 -07:00
2017-09-26 00:32:37 -07:00
2018-02-17 13:21:15 +01:00
2017-07-12 17:07:29 +02:00
2023-05-15 12:06:00 +09:00
2017-07-21 08:55:50 +02:00
2017-06-14 15:06:01 +02:00
2017-12-20 10:51:15 +01:00