public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zach Brown <zab@zabbo.net>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.39 list_head debugging
Date: Sun, 29 Sep 2002 10:30:24 -0400	[thread overview]
Message-ID: <20020929103024.B13755@bitchcake.off.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0209291027120.12583-100000@localhost.localdomain>; from mingo@elte.hu on Sun, Sep 29, 2002 at 10:33:15AM +0200

> > This patch adds some straight-forward assertions that check the
> > validity of arguments to the list_* inlines. [...]
> 
> +	BUG_ON(list == NULL);
> +	BUG_ON(list->next == NULL);
> +	BUG_ON(list->prev == NULL);

oh, sorry, I'm reminded that list->next == NULL check is indeed needed.
list_empty(list) will fail when the elements are null (list->NULL !=
list) but the entry isn't on any lists.  

so we can lose the first check, sure, it was just cute, but I'd like to
keep checking for null member pointers.  They already found a bug in
vmscan.c where list_empty(mapping->blahblah) was failing for the swapper
mapping even though it was on no lists.  (harmless?  perhaps, but not
the symantics list_head is trying to provide)

- z

  parent reply	other threads:[~2002-09-29 14:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-29  5:58 [PATCH] 2.5.39 list_head debugging Zach Brown
2002-09-29  6:12 ` Andrew Morton
2002-09-29  6:24   ` Zach Brown
2002-09-29  8:33 ` Ingo Molnar
2002-09-29 14:27   ` Zach Brown
2002-09-29 14:28     ` Martin J. Bligh
2002-09-29 14:30   ` Zach Brown [this message]
2002-09-29 17:22 ` Dave Jones
2002-09-29 20:22   ` Zach Brown

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=20020929103024.B13755@bitchcake.off.net \
    --to=zab@zabbo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.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