]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix block reservation for bigalloc filesystems
authorJan Kara <jack@suse.cz>
Tue, 25 Nov 2014 16:41:49 +0000 (11:41 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 25 Nov 2014 16:41:49 +0000 (11:41 -0500)
commiteb3cd841dedab8f06fe1af69d6e6ae3667eebfac
tree55594320c91d408ab9aa63f8fc1ef79b3556cd14
parent8348a8e8e9fb6dd6f9c4aff8e3fe9b0b8a58044d
ext4: fix block reservation for bigalloc filesystems

For bigalloc filesystems we have to check whether newly requested inode
block isn't already part of a cluster for which we already have delayed
allocation reservation. This check happens in ext4_ext_map_blocks() and
that function sets EXT4_MAP_FROM_CLUSTER if that's the case. However if
ext4_da_map_blocks() finds in extent cache information about the block,
we don't call into ext4_ext_map_blocks() and thus we always end up
getting new reservation even if the space for cluster is already
reserved. This results in overreservation and premature ENOSPC reports.

Fix the problem by checking for existing cluster reservation already in
ext4_da_map_blocks(). That simplifies the logic and actually allows us
to get rid of the EXT4_MAP_FROM_CLUSTER flag completely.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/inode.c
include/trace/events/ext4.h