]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix data corruption in inodes with journalled data
authorJan Kara <jack@suse.cz>
Tue, 26 Jul 2011 13:07:11 +0000 (09:07 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 26 Jul 2011 13:07:11 +0000 (09:07 -0400)
commitec1a1a993827b9409f3fe3a6b1d9b1bca3c481a6
treed725aca3ab9555b8ee92f753a797034ff79f580c
parentab9b447f4f3bcbdb81838ce79ff15cc9707f302b
ext4: fix data corruption in inodes with journalled data

When journalling data for an inode (either because it is a symlink or
because the filesystem is mounted in data=journal mode), ext4_evict_inode()
can discard unwritten data by calling truncate_inode_pages(). This is
because we don't mark the buffer / page dirty when journalling data but only
add the buffer to the running transaction and thus mm does not know there
are still unwritten data.

Fix the problem by carefully tracking transaction containing inode's data,
committing this transaction, and writing uncheckpointed buffers when inode
should be reaped.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/inode.c