Skip to content
Commit 98397ff3 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: fix not to allocate unnecessary blocks during fallocate



This patch fixes the fallocate bug like below. (See xfstests/255)

In fallocate(fd, 0, 20480),
expand_inode_data processes
	for (index = pg_start; index <= pg_end; index++) {
		f2fs_reserve_block();
		...
	}

So, even though fallocate requests 20480, 5 blocks, f2fs allocates 6 blocks
including pg_end.
So, this patch adds one condition to avoid block allocation.

Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent ead43275
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment