summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorAkira Fujita <a-fujita@rs.jp.nec.com>2011-10-21 00:56:10 +0200
committerTheodore Ts'o <tytso@mit.edu>2011-10-21 00:56:10 +0200
commit09e0834fb0ce1ea2a63885177015bd5d7d2bc22d (patch)
tree52f8efc4bd21cc93d27cfb9071decc6996065071 /fs/ext4
parentext4: quiet sparse noise about plain integer as NULL pointer (diff)
downloadlinux-09e0834fb0ce1ea2a63885177015bd5d7d2bc22d.tar.xz
linux-09e0834fb0ce1ea2a63885177015bd5d7d2bc22d.zip
ext4: fix deadlock in ext4_ordered_write_end()
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 081bb25a9ad3..ecb572591924 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -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;