]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix up error handling for mpage_map_and_submit_extent()
authorTheodore Ts'o <tytso@mit.edu>
Mon, 1 Jul 2013 12:12:40 +0000 (08:12 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 1 Jul 2013 12:12:40 +0000 (08:12 -0400)
commit67837aca5bcf5149ea56a93277260f2c2979566a
tree2a6f2d92aa5a956eea7e47331eb1ede78e81658f
parent726c862dc1e11be9a8e06ab6a4f875011abcaf9b
ext4: fix up error handling for mpage_map_and_submit_extent()

The function mpage_released_unused_page() must only be called once;
otherwise the kernel will BUG() when the second call to
mpage_released_unused_page() tries to unlock the pages which had been
unlocked by the first call.

Also restructure the error handling so that we only give up on writing
the dirty pages in the case of ENOSPC where retrying the allocation
won't help.  Otherwise, a transient failure, such as a kmalloc()
failure in calling ext4_map_blocks() might cause us to give up on
those pages, leading to a scary message in /var/log/messages plus data
loss.

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