ext4: fix inline data updates with checksums enabled
authorTheodore Ts'o <tytso@mit.edu>
Tue, 10 Jul 2018 05:07:43 +0000 (01:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:55:26 +0000 (07:55 +0200)
commit5eed597ca6c8d34312ce1298446988431bbbcd5f
tree6888d0c662ece9acd50118f349f4e15dafe7abf2
parent1aecbe4326b1da7e4afb075c92e24ba2c52ff3e8
ext4: fix inline data updates with checksums enabled

commit 362eca70b53389bddf3143fe20f53dcce2cfdf61 upstream.

The inline data code was updating the raw inode directly; this is
problematic since if metadata checksums are enabled,
ext4_mark_inode_dirty() must be called to update the inode's checksum.
In addition, the jbd2 layer requires that get_write_access() be called
before the metadata buffer is modified.  Fix both of these problems.

https://bugzilla.kernel.org/show_bug.cgi?id=200443

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inline.c
fs/ext4/inode.c