linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fix the deadlock in ext4_ordered_write_end()
@ 2011-10-13  2:05 Akira Fujita
  2011-10-20 22:53 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Akira Fujita @ 2011-10-13  2:05 UTC (permalink / raw)
  To: ext4 development; +Cc: Theodore Tso, adilger.kernel

From: Akira Fujita <a-fujita@rs.jp.nec.com>

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>
---
 fs/ext4/inode.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 986e238..69dc2c6 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -909,7 +909,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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: fix the deadlock in ext4_ordered_write_end()
  2011-10-13  2:05 [PATCH] ext4: fix the deadlock in ext4_ordered_write_end() Akira Fujita
@ 2011-10-20 22:53 ` Ted Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-10-20 22:53 UTC (permalink / raw)
  To: Akira Fujita; +Cc: ext4 development, adilger.kernel

On Thu, Oct 13, 2011 at 11:05:52AM +0900, Akira Fujita wrote:
> From: Akira Fujita <a-fujita@rs.jp.nec.com>
> 
> 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>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-21  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13  2:05 [PATCH] ext4: fix the deadlock in ext4_ordered_write_end() Akira Fujita
2011-10-20 22:53 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).