Skip to content

Commit

Permalink
ext4: fix deadlock in ext4_ordered_write_end()
Browse files Browse the repository at this point in the history
If ext4_jbd2_file_inode() in ext4_ordered_write_end() fails for some
reasons, this function returns to caller without unlocking the page.
It leads to the deadlock, and the patch fixes this issue.

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Akira Fujita authored and Theodore Ts'o committed Oct 20, 2011
1 parent ee90d57 commit 09e0834
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,11 @@ static int ext4_ordered_write_end(struct file *file,
ext4_orphan_add(handle, inode);
if (ret2 < 0)
ret = ret2;
} else {
unlock_page(page);
page_cache_release(page);
}

ret2 = ext4_journal_stop(handle);
if (!ret)
ret = ret2;
Expand Down

0 comments on commit 09e0834

Please sign in to comment.