]> nv-tegra.nvidia Code Review - linux-2.6.git/commit
ocfs2: Move orphan scan work to ocfs2_wq.
authorTao Ma <tao.ma@oracle.com>
Fri, 28 May 2010 06:22:59 +0000 (14:22 +0800)
committerJoel Becker <joel.becker@oracle.com>
Tue, 15 Jun 2010 22:43:48 +0000 (15:43 -0700)
commit40f165f416bde747d85cdf71bc9dde700912f71f
tree9bdf36cb4ce5674cf5a743c733b16e478c2696c3
parent6469272c350872980891dbe38e81c936c43f2d9b
ocfs2: Move orphan scan work to ocfs2_wq.

We used to let orphan scan work in the default work queue,
but there is a corner case which will make the system deadlock.
The scenario is like this:
1. set heartbeat threadshold to 200. this will allow us to have a
   great chance to have a orphan scan work before our quorum decision.
2. mount node 1.
3. after 1~2 minutes, mount node 2(in order to make the bug easier
   to reproduce, better add maxcpus=1 to kernel command line).
4. node 1 do orphan scan work.
5. node 2 do orphan scan work.
6. node 1 do orphan scan work. After this, node 1 hold the orphan scan
   lock while node 2 know node 1 is the master.
7. ifdown eth2 in node 2(eth2 is what we do ocfs2 interconnection).

Now when node 2 begins orphan scan, the system queue is blocked.

The root cause is that both orphan scan work and quorum decision work
will use the system event work queue. orphan scan has a chance of
blocking the event work queue(in dlm_wait_for_node_death) so that there
is no chance for quorum decision work to proceed.

This patch resolve it by moving orphan scan work to ocfs2_wq.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/journal.c