All of lore.kernel.org
 help / color / mirror / Atom feed
* + ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null.patch added to -mm tree
@ 2015-12-18 23:51 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2015-12-18 23:51 UTC (permalink / raw)
  To: xuejiufei, jiangyiwen, jlbec, joseph.qi, junxiao.bi, mfasheh, mm-commits


The patch titled
     Subject: ocfs2/dlm: return appropriate value when dlm_grab() returns NULL
has been added to the -mm tree.  Its filename is
     ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null.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: Xue jiufei <xuejiufei@huawei.com>
Subject: ocfs2/dlm: return appropriate value when dlm_grab() returns NULL

Function dlm_grab() may return NULL when the node is doing unmount.  When
doing code review, we found that some dlm handlers may return error to
caller when dlm_grab() returns NULL and make caller BUG or other problems.
 Here is an example:

Node 1                                 Node 2
receives migration message
from node 3, and send
migrate request to others
                                     start unmounting

                                     receives migrate request
                                     from node 1 and call
                                     dlm_migrate_request_handler()

                                     unmount thread unregisters
                                     domain handlers and removes
                                     dlm_context from dlm_domains

                                     dlm_migrate_request_handlers()
                                     returns -EINVAL to node 1
Exit migration neither clearing the
migration state nor sending
assert master message to node 3 which
cause node 3 hung.

Signed-off-by: Jiufei Xue <xuejiufei@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ocfs2/dlm/dlmmaster.c |    2 +-
 fs/ocfs2/dlm/dlmunlock.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN fs/ocfs2/dlm/dlmmaster.c~ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null fs/ocfs2/dlm/dlmmaster.c
--- a/fs/ocfs2/dlm/dlmmaster.c~ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null
+++ a/fs/ocfs2/dlm/dlmmaster.c
@@ -3048,7 +3048,7 @@ int dlm_migrate_request_handler(struct o
 	int ret = 0;
 
 	if (!dlm_grab(dlm))
-		return -EINVAL;
+		return 0;
 
 	name = migrate->name;
 	namelen = migrate->namelen;
diff -puN fs/ocfs2/dlm/dlmunlock.c~ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null fs/ocfs2/dlm/dlmunlock.c
--- a/fs/ocfs2/dlm/dlmunlock.c~ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null
+++ a/fs/ocfs2/dlm/dlmunlock.c
@@ -421,7 +421,7 @@ int dlm_unlock_lock_handler(struct o2net
 	}
 
 	if (!dlm_grab(dlm))
-		return DLM_REJECTED;
+		return DLM_FORWARD;
 
 	mlog_bug_on_msg(!dlm_domain_fully_joined(dlm),
 			"Domain %s not fully joined!\n", dlm->name);
_

Patches currently in -mm which might be from xuejiufei@huawei.com are

ocfs2-dlm-fix-a-race-between-purge-and-migratio.patch
ocfs2-dlm-fix-a-race-between-purge-and-migratio-v2.patch
ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null.patch
ocfs2-extend-transaction-for-ocfs2_remove_rightmost_path-and-ocfs2_update_edge_lengths-before-to-avoid-inconsistency-between-inode-and-et.patch
extend-enough-credits-for-freeing-one-truncate-record-while-replaying-truncate-records.patch


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

only message in thread, other threads:[~2015-12-18 23:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18 23:51 + ocfs2-dlm-return-appropriate-value-when-dlm_grab-returns-null.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.