From: Srinivas Eeda <srinivas.eeda@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] remove lockres from purge list when we are getting it for creating lock
Date: Thu, 09 Jun 2011 00:43:28 -0700 [thread overview]
Message-ID: <4DF079A0.9000902@oracle.com> (raw)
In-Reply-To: <20110609064048.GA18176@laptop.jp.oracle.com>
>>> + spin_unlock(&tmpres->spinlock);
>>> + spin_unlock(&dlm->spinlock);
>> lockres could still get added to purgelist at this point and we
>> could still have the same problem? I think, here we need some
>> mechanism that marks the lockres is in use that would protect it
>> from adding to the purgelist?
> Seems there shouldn't be the possibility that the lockres was moved to purge
> list again.
I think you are right about that once removed from the purge list it
will not be put back again on the purgelist in this case :)
I still think that there is a hole here. Is it possible that the
spinlocks are released here and right then dlm_thread was walking
through dirty list and then it could put this on purge list for the
first time?
If it's already on purgelist, then we seem to be safe by removing it.
But what is preventing the lockres getting onto to purge list right at
this point. locks are added to lockres a little later but till then it
is not safe?(I think).
> We are in the case of a "create lock", there should not be any
> outstanding convert/unlock request in progress concurrently. If there is one,
> the there must be lock(s) attached to the lockres. But if there are locks
> attached, the lockres can't be purged. Also for concurrent "create lock", there
> is no problem either because there must be a lock attached to the lockres.
>
> I think your patch works too. But changing
> DLM_LOCK_RES_IN_USE
> to
> DLM_LOCK_RES_CREATING_LOCK
> can help understand better.
I am ok with the name :). The thing we should do here is once we found a
lockres and moving ahead with create lock request, we should be sure
it's protected before releasing the spinlocks.
> I also thought about inflight_locks, but so far I failed to find correct
> places to drop it.
>
> thanks,
> wengang.
>>> if (res)
>>> dlm_lockres_put(res);
>>> res = tmpres;
next prev parent reply other threads:[~2011-06-09 7:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 10:04 [Ocfs2-devel] [PATCH] remove lockres from purge list when we are getting it for creating lock Wengang Wang
2011-06-09 5:17 ` Srinivas Eeda
2011-06-09 6:40 ` Wengang Wang
2011-06-09 7:43 ` Srinivas Eeda [this message]
2011-06-09 8:10 ` Wengang Wang
2011-06-09 18:34 ` Sunil Mushran
2011-06-10 0:32 ` Wengang Wang
2011-06-10 0:43 ` Sunil Mushran
2011-06-09 17:53 ` Sunil Mushran
2011-06-10 1:01 ` Wengang Wang
2011-06-10 1:10 ` Sunil Mushran
2011-06-10 1:21 ` 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=4DF079A0.9000902@oracle.com \
--to=srinivas.eeda@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 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.