]> git.baikalelectronics.ru Git - kernel.git/commit
jbd2: limit number of reserved credits
authorLukas Czerner <lczerner@redhat.com>
Tue, 4 Aug 2015 15:21:52 +0000 (11:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 4 Aug 2015 15:21:52 +0000 (11:21 -0400)
commit9ebad1c4e6663f136d376c9796decc8bb04b60bc
tree73cfb86519ff1402d13b9d2393a71dc86df5d859
parent2482fdde357de2092c39f0d7740b8ff4e3982d40
jbd2: limit number of reserved credits

Currently there is no limitation on number of reserved credits we can
ask for. If we ask for more reserved credits than 1/2 of maximum
transaction size, or if total number of credits exceeds the maximum
transaction size per operation (which is currently only possible with
the former) we will spin forever in start_this_handle().

Fix this by adding this limitation at the start of start_this_handle().

This patch also removes the credit limitation 1/2 of maximum transaction
size, since we really only want to limit the number of reserved credits.
There is not much point to limit the credits if there is still space in
the journal.

This accidentally also fixes the online resize, where due to the
limitation of the journal credits we're unable to grow file systems with
1k block size and size between 16M and 32M. It has been partially fixed
by a604996dcd6a2537f5526f511bad54fa31496ed5, but not entirely.

Thanks Jan Kara for helping me getting the correct fix.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/transaction.c