diff options
author | Jan Kara <jack@suse.cz> | 2019-01-29 17:17:24 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-23 13:19:48 +0100 |
commit | 4b5f060b09f6ebdf86fc2acb483bdfcc5d723000 (patch) | |
tree | b10436da6faaa975d1fd0ddc8926b05049d3b297 /fs/mbcache.c | |
parent | 14a0bfda4d24aa8d20f2445530ee98b866849341 (diff) |
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>
Diffstat (limited to 'fs/mbcache.c')
0 files changed, 0 insertions, 0 deletions