]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: recalculate journal credits as inode depth changes
authorLukas Czerner <lczerner@redhat.com>
Mon, 15 Jun 2015 04:20:46 +0000 (00:20 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 15 Jun 2015 04:20:46 +0000 (00:20 -0400)
commitedc1f6758f8e926c9612497da903f17e274b62ec
tree90fe66d8fdec941bff0ce300a9d74335a0f27239
parent725e36ee7a530b1ca41573f1a8a9b4a639f9112e
ext4: recalculate journal credits as inode depth changes

Currently in ext4_alloc_file_blocks() the number of credits is
calculated only once before we enter the allocation loop. However within
the allocation loop the extent tree depth can change, hence the number
of credits needed can increase potentially exceeding the number of credits
reserved in the handle which can cause journal failures.

Fix this by recalculating number of credits when the inode depth
changes. Note that even though ext4_alloc_file_blocks() is only
currently used by extent base inodes we will avoid recalculating number
of credits unnecessarily in the case of indirect based inodes.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/extents.c