+ ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: ocfs2/cluster: unlock the o2hb_live_lock before the o2nm_depend_item()
has been added to the -mm tree.  Its filename is
     ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: alex chen <alex.chen@xxxxxxxxxx>
Subject: ocfs2/cluster: unlock the o2hb_live_lock before the o2nm_depend_item()

In the following situation, the down_write() will be called under the
spin_lock(), which may lead a soft lockup:

o2hb_region_inc_user
 spin_lock(&o2hb_live_lock)
  o2hb_region_pin
   o2nm_depend_item
    configfs_depend_item
     inode_lock
      down_write
      -->here may sleep and reschedule

So we should unlock the o2hb_live_lock before the o2nm_depend_item(), and
get item reference in advance to prevent the region to be released.

Link: http://lkml.kernel.org/r/59FAB46C.9050703@xxxxxxxxxx
Signed-off-by: Alex Chen <alex.chen@xxxxxxxxxx>
Reviewed-by: Yiwen Jiang <jiangyiwen@xxxxxxxxxx>
Reviewed-by: Jun Piao <piaojun@xxxxxxxxxx>
Cc: Mark Fasheh <mfasheh@xxxxxxxxxxx>
Cc: Joel Becker <jlbec@xxxxxxxxxxxx>
Cc: Junxiao Bi <junxiao.bi@xxxxxxxxxx>
Cc: Joseph Qi <jiangqi903@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/ocfs2/cluster/heartbeat.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff -puN fs/ocfs2/cluster/heartbeat.c~ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item fs/ocfs2/cluster/heartbeat.c
--- a/fs/ocfs2/cluster/heartbeat.c~ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item
+++ a/fs/ocfs2/cluster/heartbeat.c
@@ -2399,8 +2399,15 @@ static int o2hb_region_pin(const char *r
 		if (reg->hr_item_pinned || reg->hr_item_dropped)
 			goto skip_pin;
 
+		config_item_get(&reg->hr_item);
+		spin_unlock(&o2hb_live_lock);
+
 		/* Ignore ENOENT only for local hb (userdlm domain) */
 		ret = o2nm_depend_item(&reg->hr_item);
+
+		config_item_put(&reg->hr_item);
+		spin_lock(&o2hb_live_lock);
+
 		if (!ret) {
 			mlog(ML_CLUSTER, "Pin region %s\n", uuid);
 			reg->hr_item_pinned = 1;
_

Patches currently in -mm which might be from alex.chen@xxxxxxxxxx are

ocfs2-should-wait-dio-before-inode-lock-in-ocfs2_setattr.patch
ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch
ocfs2-subsystemsu_mutex-is-required-while-accessing-the-item-ci_parent.patch
ocfs2-the-ip_alloc_sem-should-be-taken-in-ocfs2_get_block.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux