• Jan Kara's avatar
    ext4: Support for checksumming from journal triggers · 188c299e
    Jan Kara authored
    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 superblock and journal trigger type arguments to
    ext4_journal_get_write_access() and ext4_journal_get_create_access() so
    that frozen triggers can be set accordingly. Also add inode argument to
    ext4_walk_page_buffers() and all the callbacks used with that function
    for the same purpose. This patch is mostly only a change of prototype of
    the above mentioned functions and a few small helpers. Real checksumming
    will come later.
    Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Link: https://lore.kernel.org/r/20210816095713.16537-1-jack@suse.czSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    188c299e
indirect.c 42.8 KB