All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH][ocfs2/dlm] fix dlm_clean_master_list
Date: Thu, 22 Dec 2011 15:08:14 -0800	[thread overview]
Message-ID: <4EF3B85E.3050305@oracle.com> (raw)
In-Reply-To: <201112210248.pBL2mvw1032148@acsmt357.oracle.com>

On 12/20/2011 06:49 PM, Wengang Wang wrote:
> This is a fix on dlm_clean_master_list()
>
> During the hash table browsing, we remove mle from hash table then free
> the memory on the last reference. So we have to use a _safe() version
> of the browsing function when doing that.
>
> This fixes Orabug #12798517
>
> Signed-off-by: Wengang Wang<wen.gang.wang@oracle.com>
> ---
>   fs/ocfs2/dlm/dlmmaster.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index 11eefb8..86ec9d2 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -3182,7 +3182,7 @@ void dlm_clean_master_list(struct dlm_ctxt *dlm, u8 dead_node)
>   	struct dlm_master_list_entry *mle;
>   	struct dlm_lock_resource *res;
>   	struct hlist_head *bucket;
> -	struct hlist_node *list;
> +	struct hlist_node *list, *n;

Single char names are typically used for counters, etc. Call it tmp.
Else it looks good.

>   	unsigned int i;
>
>   	mlog(0, "dlm=%s, dead node=%u\n", dlm->name, dead_node);
> @@ -3193,7 +3193,7 @@ top:
>   	spin_lock(&dlm->master_lock);
>   	for (i = 0; i<  DLM_HASH_BUCKETS; i++) {
>   		bucket = dlm_master_hash(dlm, i);
> -		hlist_for_each(list, bucket) {
> +		hlist_for_each_safe(list, n, bucket) {
>   			mle = hlist_entry(list, struct dlm_master_list_entry,
>   					  master_hash_node);
>

      reply	other threads:[~2011-12-22 23:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21  2:49 [Ocfs2-devel] [PATCH][ocfs2/dlm] fix dlm_clean_master_list Wengang Wang
2011-12-22 23:08 ` Sunil Mushran [this message]

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=4EF3B85E.3050305@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 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.