]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ext4: fix data corruption in data=journal mode
authorJan Kara <jack@suse.cz>
Fri, 27 Jan 2017 19:35:38 +0000 (14:35 -0500)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 13 Mar 2017 21:20:54 +0000 (15:20 -0600)
commitfb97071a7db33d96aa1a4b79479f6cbe0a3ded21
treeb241bb60fdfbc775cda7095b5e3b73be4817d40e
parent7c864b9d4ac1b1ba3443f2aaf072e5df058ad59b
ext4: fix data corruption in data=journal mode

BugLink: http://bugs.launchpad.net/bugs/1672544
commit 3b136499e906460919f0d21a49db1aaccf0ae963 upstream.

ext4_journalled_write_end() did not propely handle all the cases when
generic_perform_write() did not copy all the data into the target page
and could mark buffers with uninitialized contents as uptodate and dirty
leading to possible data corruption (which would be quickly fixed by
generic_perform_write() retrying the write but still). Fix the problem
by carefully handling the case when the page that is written to is not
uptodate.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/ext4/inode.c