]> git.baikalelectronics.ru Git - kernel.git/commit
jbd2: avoid leaking transaction credits when unreserving handle
authorJan Kara <jack@suse.cz>
Wed, 20 May 2020 13:31:19 +0000 (15:31 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 4 Jun 2020 03:16:53 +0000 (23:16 -0400)
commit8d727e99962bd3cae7ed22865647238e0d36ea7f
tree03e7f6de9cd898f9506df9e67fabc96ed868e2ee
parent6eb209ddaad21bf8d3e87c4409b7d375133ea9e5
jbd2: avoid leaking transaction credits when unreserving handle

When reserved transaction handle is unused, we subtract its reserved
credits in __jbd2_journal_unreserve_handle() called from
jbd2_journal_stop(). However this function forgets to remove reserved
credits from transaction->t_outstanding_credits and thus the transaction
space that was reserved remains effectively leaked. The leaked
transaction space can be quite significant in some cases and leads to
unnecessarily small transactions and thus reducing throughput of the
journalling machinery. E.g. fsmark workload creating lots of 4k files
was observed to have about 20% lower throughput due to this when ext4 is
mounted with dioread_nolock mount option.

Subtract reserved credits from t_outstanding_credits as well.

CC: stable@vger.kernel.org
Fixes: 49d03d333f12 ("jbd2: transaction reservation support")
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200520133119.1383-3-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/transaction.c