On Mon, Jul 12, 2021 at 05:40:05PM +0200, Jan Kara wrote: > JBD2 layer support triggers which are called when journaling layer moves > buffer to a certain state. We can use the frozen trigger, which gets > called when buffer data is frozen and about to be written out to the > journal, to compute block checksums for some buffer types (similarly as > does ocfs2). This avoids unnecessary repeated recomputation of the > checksum (at the cost of larger window where memory corruption won't be > caught by checksumming) and is even necessary when there are > unsynchronized updaters of the checksummed data. > > So add argument to ext4_journal_get_write_access() and > ext4_journal_get_create_access() which describes buffer type so that > triggers can be set accordingly. This patch is mostly only a change of > prototype of the above mentioned functions and a few small helpers. Real > checksumming will come later. > > Signed-off-by: Jan Kara <jack@xxxxxxx> Looks good. I would have preferred mention of the change to ext4_walk_page_buffers in the commit description, but I guess this was considered one of the "few small helpers". :-) The WARN_ON_ONCE change in jbd2_journal_set_triggers is a somewhat tangentially-related unrelated change, but I think I understand why it was made. Reviewed-by: Theodore Ts'o <tytso@xxxxxxx> - Ted