From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2/dlm: remove unreasonable BUG_ON()
Date: Tue, 25 May 2010 10:22:12 -0700 [thread overview]
Message-ID: <4BFC0744.6050804@oracle.com> (raw)
In-Reply-To: <201005251058.o4PAhNOK013998@acsinet15.oracle.com>
NAK
How did this lockres get into the dirty list? The dlm only adds locks that
it owns to that list. And such locks, by definition, can never be in the
recovery list.
On 05/25/2010 03:57 AM, Wengang Wang wrote:
> A node "down" can happen at any time. When that happens, all locres' owned
> by the "down" node are move to recovery list. They also are marked as in
> recovery and the owner are set to "unknown" under dlm->spinlock and
> res->spinlock.
>
> Any place shouldn't believe the owner is not changed to "unknown" after
> dropping the lockres and retaking them.
>
> Signed-off-by: Wengang Wang<wen.gang.wang@oracle.com>
> ---
> fs/ocfs2/dlm/dlmthread.c | 17 +++++++++--------
> 1 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c
> index 11a6d1f..cf86b43 100644
> --- a/fs/ocfs2/dlm/dlmthread.c
> +++ b/fs/ocfs2/dlm/dlmthread.c
> @@ -675,15 +675,16 @@ static int dlm_thread(void *data)
> * dirty_list in this gap, but that is ok */
>
> spin_lock(&res->spinlock);
> - if (res->owner != dlm->node_num) {
> - __dlm_print_one_lock_resource(res);
> - mlog(ML_ERROR, "inprog:%s, mig:%s, reco:%s, dirty:%s\n",
> - res->state& DLM_LOCK_RES_IN_PROGRESS ? "yes" : "no",
> - res->state& DLM_LOCK_RES_MIGRATING ? "yes" : "no",
> - res->state& DLM_LOCK_RES_RECOVERING ? "yes" : "no",
> - res->state& DLM_LOCK_RES_DIRTY ? "yes" : "no");
> + if (unlikely(res->owner != dlm->node_num)) {
> + /*
> + * there is chance that the lockres is marked
> + * as in recovery if a node down happened.
> + */
> + if (!(res->state& DLM_LOCK_RES_RECOVERING)) {
> + __dlm_print_one_lock_resource(res);
> + BUG();
> + }
> }
> - BUG_ON(res->owner != dlm->node_num);
>
> /* it is now ok to move lockreses in these states
> * to the dirty list, assuming that they will only be
>
next prev parent reply other threads:[~2010-05-25 17:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 10:57 [Ocfs2-devel] [PATCH] ocfs2/dlm: remove unreasonable BUG_ON() Wengang Wang
2010-05-25 17:22 ` Sunil Mushran [this message]
2010-05-26 1:54 ` Wengang Wang
2010-05-26 2:27 ` Sunil Mushran
2010-06-11 10:26 ` Wengang Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BFC0744.6050804@oracle.com \
--to=sunil.mushran@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).