From: tristan <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] Ocfs2: Handle empty list in lockres_seq_start() for dlmdebug.c
Date: Fri, 10 Sep 2010 10:31:01 +0800 [thread overview]
Message-ID: <4C899865.6010909@oracle.com> (raw)
In-Reply-To: <4C8995A1.3010700@oracle.com>
Sunil Mushran wrote:
> Signed-off-by: Sunil Mushran<sunil.mushran@oracle.com>
>
> I am assuming you have tested it. ;)
Sure, both in local mode by creating a user dlm domain, and in a cluster.
>
>
> On 09/09/2010 07:16 PM, Tristan Ye wrote:
>> This patch tries to handle the case in which list
>> 'dlm->tracking_list' is
>> empty, to avoid accessing an invalid pointer. It fixes the following
>> oops:
>>
>> http://oss.oracle.com/bugzilla/show_bug.cgi?id=1287
>>
>> Signed-off-by: Tristan Ye<tristan.ye@oracle.com>
>> ---
>> fs/ocfs2/dlm/dlmdebug.c | 9 ++++++++-
>> 1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
>> index 5efdd37..901ca52 100644
>> --- a/fs/ocfs2/dlm/dlmdebug.c
>> +++ b/fs/ocfs2/dlm/dlmdebug.c
>> @@ -636,8 +636,14 @@ static void *lockres_seq_start(struct seq_file
>> *m, loff_t *pos)
>> spin_lock(&dlm->track_lock);
>> if (oldres)
>> track_list =&oldres->tracking;
>> - else
>> + else {
>> track_list =&dlm->tracking_list;
>> + if (list_empty(track_list)) {
>> + dl = NULL;
>> + spin_unlock(&dlm->track_lock);
>> + goto bail;
>> + }
>> + }
>>
>> list_for_each_entry(res, track_list, tracking) {
>> if (&res->tracking ==&dlm->tracking_list)
>> @@ -660,6 +666,7 @@ static void *lockres_seq_start(struct seq_file
>> *m, loff_t *pos)
>> } else
>> dl = NULL;
>>
>> +bail:
>> /* passed to seq_show */
>> return dl;
>> }
>>
>
next prev parent reply other threads:[~2010-09-10 2:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 2:16 [Ocfs2-devel] [PATCH 1/1] Ocfs2: Handle empty list in lockres_seq_start() for dlmdebug.c Tristan Ye
2010-09-10 2:19 ` Sunil Mushran
2010-09-10 2:31 ` tristan [this message]
2010-09-10 16:22 ` Joel Becker
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=4C899865.6010909@oracle.com \
--to=tristan.ye@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.