linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/15] ext4: Fix transaction overflow due to revoke descriptors
@ 2019-09-27 11:15 Jan Kara
  2019-09-27 11:15 ` [PATCH 01/15] jbd2: Fix possible overflow in jbd2_log_space_left() Jan Kara
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Jan Kara @ 2019-09-27 11:15 UTC (permalink / raw)
  To: linux-ext4; +Cc: Ted Tso, Jan Kara

Hello,

I've recently got a bug report where JBD2 assertion failed due to
transaction commit running out of journal space. After closer inspection of
the crash dump it seems that the problem is that there were too many
journal descriptor blocks (more that max_transaction_size >> 5 + 32 we
estimate in jbd2_log_space_left()) due to descriptor blocks with revoke
records. In fact the estimate on the number of descriptor blocks looks
pretty arbitrary and there can be much more descriptor blocks needed for
revoke records. We need one revoke record for every metadata block freed.
So in the worst case (1k blocksize, 64-bit journal feature enabled,
checksumming enabled) we fit 125 revoke record in one descriptor block.  In
common cases its about 500 revoke records per descriptor block. Now when
we free large directories or large file with data journalling enabled, we can
have *lots* of blocks to revoke - with extent mapped files easily millions
in a single transaction which can mean 10k descriptor blocks - clearly more
than the estimate of 128 descriptor blocks per transaction ;)

This patch series aims at fixing the problem by accounting descriptor blocks
into transaction credits and reserving appropriate amount of credits for revoke
descriptors on transaction handle start. Similar to normal transaction credits,
the filesystem has to provide estimate for the number of blocks it is going
to revoke using the transaction handle so that credits for revoke descriptors
can be reserved.

The series has survived fstests in couple configurations and also the stress
test of deleting large files in -o nodelalloc,data=journal configuration which
reliably triggers the assertion failure in JBD2 on unpatched kernel.

Review and comments are welcome :).

								Honza

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-09-27 11:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 11:15 [PATCH 0/15] ext4: Fix transaction overflow due to revoke descriptors Jan Kara
2019-09-27 11:15 ` [PATCH 01/15] jbd2: Fix possible overflow in jbd2_log_space_left() Jan Kara
2019-09-27 11:15 ` [PATCH 02/15] jbd2: Fixup stale comment in commit code Jan Kara
2019-09-27 11:15 ` [PATCH 03/15] ext4: Do not iput inode under running transaction in ext4_mkdir() Jan Kara
2019-09-27 11:15 ` [PATCH 04/15] ext4: Use ext4_journal_extend() instead of jbd2_journal_extend() Jan Kara
2019-09-27 11:15 ` [PATCH 05/15] jbd2: Reorganize jbd2_journal_stop() Jan Kara
2019-09-27 11:15 ` [PATCH 06/15] jbd2: Drop pointless check from jbd2_journal_stop() Jan Kara
2019-09-27 11:15 ` [PATCH 07/15] jbd2: Drop pointless wakeup " Jan Kara
2019-09-27 11:15 ` [PATCH 08/15] jbd2: Factor out common parts of stopping and restarting a handle Jan Kara
2019-09-27 11:15 ` [PATCH 09/15] jbd2: Account descriptor blocks into t_outstanding_credits Jan Kara
2019-09-27 11:15 ` [PATCH 10/15] jbd2: Drop jbd2_space_needed() Jan Kara
2019-09-27 11:15 ` [PATCH 11/15] jbd2: Reserve space for revoke descriptor blocks Jan Kara
2019-09-27 11:15 ` [PATCH 12/15] ext4: Avoid unnecessary revokes in ext4_alloc_branch() Jan Kara
2019-09-27 11:15 ` [PATCH 13/15] jbd2: Fix statistics for the number of logged blocks Jan Kara
2019-09-27 11:15 ` [PATCH 14/15] ext4: Provide function to handle transaction restarts Jan Kara
2019-09-27 11:15 ` [PATCH 15/15] ext4: Reserve revoke credits for freed blocks Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).