]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ext4: fix deadlock in ext4_ordered_write_end()
authorAkira Fujita <a-fujita@rs.jp.nec.com>
Thu, 20 Oct 2011 22:56:10 +0000 (18:56 -0400)
committerGuangyu Sun <guangyu.sun@oracle.com>
Thu, 15 Mar 2012 19:24:38 +0000 (12:24 -0700)
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>
fs/ext4/inode.c

index 00523341b77a9dc6713b66fef8382bf350827d16..fcedaa312be42f0645b25a840ba390b94150426b 100644 (file)
@@ -1775,7 +1775,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;