ext3: Fix data corruption in inodes with journalled data
authorJan Kara <jack@suse.cz>
Fri, 22 Jul 2011 23:21:38 +0000 (01:21 +0200)
committerJan Kara <jack@suse.cz>
Fri, 22 Jul 2011 23:49:00 +0000 (01:49 +0200)
commitb22570d9abb3d844e65c15c8bc0d57a78129e3b4
tree455217fe8cac7529c1ed6ce351cde629729c90c4
parent03b5bb342978f99f75fb36d69cd29bab32109fd4
ext3: 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), ext3_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>
fs/ext3/inode.c