public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: Dave Jones <davej@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] list debugging: warn when deleting a deleted entry
Date: Sun, 16 May 2010 08:45:57 +0300	[thread overview]
Message-ID: <20100516054557.GA9373@tarshish> (raw)
In-Reply-To: <5e659adf538ddcba285c1e8963f4438828c29902.1273047097.git.baruch@tkos.co.il>

Hi Dave,

Ping?
Any comment on this?

baruch

On Wed, May 05, 2010 at 11:14:29AM +0300, Baruch Siach wrote:
> Use the magic LIST_POISON* values to detect an incorrect use of list_del on a
> deleted entry. This DEBUG_LIST specific warning is easier to understand than
> the generic Oops message caused by LIST_POISON dereference.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  lib/list_debug.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/list_debug.c b/lib/list_debug.c
> index 1a39f4e..344c710 100644
> --- a/lib/list_debug.c
> +++ b/lib/list_debug.c
> @@ -43,6 +43,12 @@ EXPORT_SYMBOL(__list_add);
>   */
>  void list_del(struct list_head *entry)
>  {
> +	WARN(entry->next == LIST_POISON1,
> +		"list_del corruption, next is LIST_POISON1 (%p)\n",
> +		LIST_POISON1);
> +	WARN(entry->next != LIST_POISON1 && entry->prev == LIST_POISON2,
> +		"list_del corruption, prev is LIST_POISON2 (%p)\n",
> +		LIST_POISON2);
>  	WARN(entry->prev->next != entry,
>  		"list_del corruption. prev->next should be %p, "
>  		"but was %p\n", entry, entry->prev->next);
> -- 
> 1.7.0
> 

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

  reply	other threads:[~2010-05-16  5:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05  8:14 [PATCH] list debugging: warn when deleting a deleted entry Baruch Siach
2010-05-16  5:45 ` Baruch Siach [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-07-15 11:51 Baruch Siach

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=20100516054557.GA9373@tarshish \
    --to=baruch@tkos.co.il \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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