ext4: fix mmap write protection for data=journal mode
authorJan Kara <jack@suse.cz>
Tue, 27 Oct 2020 13:27:51 +0000 (14:27 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 28 Oct 2020 17:42:42 +0000 (13:42 -0400)
commitb5b18160a3e7a9f55e3528d77051670cca6d9314
tree7aeada62c004bbe8858a52f8a4d984ee7e2d4756
parentea4b01d9b81f5f381fc6832bc31046878a2d1a5d
ext4: fix mmap write protection for data=journal mode

Commit afb585a97f81 "ext4: data=journal: write-protect pages on
j_submit_inode_data_buffers()") added calls ext4_jbd2_inode_add_write()
to track inode ranges whose mappings need to get write-protected during
transaction commits.  However the added calls use wrong start of a range
(0 instead of page offset) and so write protection is not necessarily
effective.  Use correct range start to fix the problem.

Fixes: afb585a97f81 ("ext4: data=journal: write-protect pages on j_submit_inode_data_buffers()")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20201027132751.29858-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c