mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [to-be-updated] ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch removed from -mm tree
@ 2017-11-02 20:55 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-11-02 20:55 UTC (permalink / raw)
  To: alex.chen, jiangqi903, jiangyiwen, jlbec, junxiao.bi, mfasheh,
	piaojun, mm-commits


The patch titled
     Subject: ocfs2/cluster: unlock the o2hb_live_lock before the o2nm_depend_item()
has been removed from the -mm tree.  Its filename was
     ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: alex chen <alex.chen@huawei.com>
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@huawei.com
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
Reviewed-by: Jun Piao <piaojun@huawei.com>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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@huawei.com are

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-02 20:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 20:55 [to-be-updated] ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch removed from -mm tree akpm

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).