Skip to content
Commit d4381472 authored by Eryu Guan's avatar Eryu Guan Committed by Theodore Ts'o
Browse files

ext4: no need to remove extent if len is 0 in ext4_es_remove_extent()



len is 0 means no extent needs to be removed, so return immediately.
Otherwise it could trigger the following BUG_ON() in
ext4_es_remove_extent()

	end = lblk + len - 1;
	BUG_ON(end < lblk);

This could be reproduced by a simple truncate(1) command by an
unprivileged user

	truncate -s $(($((2**32 - 1)) * 4096)) /mnt/ext4/testfile

The same is true for __es_insert_extent().

Patched kernel passed xfstests regression test.

Signed-off-by: default avatarEryu Guan <guaneryu@gmail.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarZheng Liu <wenqing.lz@taobao.com>
parent 1231b3a1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment