Files
linux-legacy/fs/ext3
Jan Kara e5a1a67df4 ext3: Fix data / filesystem corruption when write fails to copy data
commit 68eb3db08344286733adac48304d9fb7a0e53b27 upstream.

When ext3_write_begin fails after allocating some blocks or
generic_perform_write fails to copy data to write, we truncate blocks already
instantiated beyond i_size. Although these blocks were never inside i_size, we
have to truncate pagecache of these blocks so that corresponding buffers get
unmapped. Otherwise subsequent __block_prepare_write (called because we are
retrying the write) will find the buffers mapped, not call ->get_block, and
thus the page will be backed by already freed blocks leading to filesystem and
data corruption.

Reported-by: James Y Knight <foom@fuhm.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-18 13:44:18 -08:00
..
2009-06-24 08:17:04 -04:00
2007-10-17 08:42:47 -07:00
2009-04-02 19:04:52 -07:00
2005-10-30 17:37:25 -08:00
2008-04-28 08:58:44 -07:00