]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: Fix hole punching for files with indirect blocks
authorJan Kara <jack@suse.cz>
Thu, 26 Jun 2014 16:30:54 +0000 (12:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 26 Jun 2014 16:30:54 +0000 (12:30 -0400)
commit689521fff67c0217cf2ef34fdcb35586dcd7cc84
tree947b96edff05559043b83190cca8a4cc5ed859c6
parent432590cd4ccfd44c4333c184318ddb4a62b3c15e
ext4: Fix hole punching for files with indirect blocks

Hole punching code for files with indirect blocks wrongly computed
number of blocks which need to be cleared when traversing the indirect
block tree. That could result in punching more blocks than actually
requested and thus effectively cause a data loss. For example:

fallocate -n -p 10240000 4096

will punch the range 10240000 - 12632064 instead of the range 1024000 -
10244096. Fix the calculation.

CC: stable@vger.kernel.org
Fixes: f6e65a61177022f19b9039daabc765ad8f7c5a52
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/indirect.c