aboutsummaryrefslogtreecommitdiff
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2009-12-08 21:24:33 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-14 09:45:13 -0800
commit35a6f7824919816fca466997531885044d290b59 (patch)
treef8c26d92e907f55075cc23ca072c9950cc8b5890 /fs/jbd2/commit.c
parent66c3a718335ccd37ac14c4f0f2d0a7551af562ed (diff)
ext4: Avoid data / filesystem corruption when write fails to copy data
(cherry picked from commit b9a4207d5e911b938f73079a83cc2ae10524ec7f) When ext4_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 the 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. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions