* + ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch added to -mm tree
@ 2017-11-02 20:42 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-11-02 20:42 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 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@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(®->hr_item);
+ spin_unlock(&o2hb_live_lock);
+
/* Ignore ENOENT only for local hb (userdlm domain) */
ret = o2nm_depend_item(®->hr_item);
+
+ config_item_put(®->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-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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-02 20:43 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:42 + ocfs2-cluster-unlock-the-o2hb_live_lock-before-the-o2nm_depend_item.patch added to -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).