Add patches to fix kernel crashes on corrupted file systems
[ext4-patch-queue.git] / fix-over-defensive-complaint-after-journal-abort
blob066c207825f1043194a2ebe84694ce4f40e594e6
1 ext4: fix over-defensive complaint after journal abort
3 From: Dmitry Monakhov <dmonakhov@openvz.org>
5 Reviewed-by: Jan Kara <jack@suse.cz>
6 Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
7 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 ---
9  fs/ext4/ext4_jbd2.c |    4 ++--
10  1 files changed, 2 insertions(+), 2 deletions(-)
12 diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
13 index 0074e0d..3445035 100644
14 --- a/fs/ext4/ext4_jbd2.c
15 +++ b/fs/ext4/ext4_jbd2.c
16 @@ -256,8 +256,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
17         set_buffer_prio(bh);
18         if (ext4_handle_valid(handle)) {
19                 err = jbd2_journal_dirty_metadata(handle, bh);
20 -               /* Errors can only happen if there is a bug */
21 -               if (WARN_ON_ONCE(err)) {
22 +               /* Errors can only happen due to aborted journal or a nasty bug */
23 +               if (!is_handle_aborted(handle) && WARN_ON_ONCE(err)) {
24                         ext4_journal_abort_handle(where, line, __func__, bh,
25                                                   handle, err);
26                         if (inode == NULL) {
27 -- 
28 1.7.1
31 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
32 the body of a message to majordomo@vger.kernel.org
33 More majordomo info at  http://vger.kernel.org/majordomo-info.html