linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Tao Ma <tm@tao.ma>
Cc: Dave Chinner <david@fromorbit.com>,
	Jiaying Zhang <jiayingz@google.com>,
	linux-ext4@vger.kernel.org
Subject: Re: [URGENT PATCH] ext4: fix potential deadlock in ext4_evict_inode()
Date: Fri, 26 Aug 2011 11:52:34 -0400	[thread overview]
Message-ID: <20110826155234.GC5176@thunk.org> (raw)
In-Reply-To: <4E57670B.6070205@tao.ma>

On Fri, Aug 26, 2011 at 05:27:39PM +0800, Tao Ma wrote:
> No, it doesn't mean the ext4_truncate. But another race pasted below.
> 
> Flush inode's i_completed_io_list before calling ext4_io_wait to
> prevent the following deadlock scenario: A page fault happens while
> some process is writing inode A. During page fault,
> shrink_icache_memory is called that in turn evicts another inode
> B. Inode B has some pending io_end work so it calls ext4_ioend_wait()
> that waits for inode B's i_ioend_count to become zero. However, inode
> B's ioend work was queued behind some of inode A's ioend work on the
> same cpu's ext4-dio-unwritten workqueue. As the ext4-dio-unwritten
> thread on that cpu is processing inode A's ioend work, it tries to
> grab inode A's i_mutex lock. Since the i_mutex lock of inode A is
> still hold before the page fault happened, we enter a deadlock.

... but that shouldn't be a problem since we're not holding A's
i_mutex at this point, right?  Or am I missing something?

	   	       	       	       - Ted

  reply	other threads:[~2011-08-26 15:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  3:33 [URGENT PATCH] ext4: fix potential deadlock in ext4_evict_inode() Theodore Ts'o
2011-08-26  3:56 ` Tao Ma
2011-08-26  9:28   ` Tao Ma
2011-08-26  7:35 ` Dave Chinner
2011-08-26  7:42   ` Tao Ma
2011-08-26  8:44   ` Dave Chinner
2011-08-26  8:50     ` Christoph Hellwig
2011-08-26  9:10       ` Tao Ma
2011-08-26  9:17         ` Christoph Hellwig
2011-08-26 11:35           ` Theodore Tso
2011-08-26 14:53             ` Tao Ma
2011-08-26  9:03     ` Tao Ma
2011-08-26  9:24       ` Dave Chinner
2011-08-26  9:27         ` Tao Ma
2011-08-26 15:52           ` Ted Ts'o [this message]
2011-08-26 16:58             ` Jiaying Zhang
2011-08-26 20:22               ` Ted Ts'o
2011-08-27  5:17                 ` Jiaying Zhang
2011-08-31  1:15                   ` Jiaying Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110826155234.GC5176@thunk.org \
    --to=tytso@mit.edu \
    --cc=david@fromorbit.com \
    --cc=jiayingz@google.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tm@tao.ma \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).