From: Patrick Mansfield <patmans@us.ibm.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] correct attribute_container list usage
Date: Mon, 22 Aug 2005 14:46:17 -0700 [thread overview]
Message-ID: <20050822214617.GA26441@us.ibm.com> (raw)
In-Reply-To: <1124723180.5211.25.camel@mulgrave>
On Mon, Aug 22, 2005 at 10:06:19AM -0500, James Bottomley wrote:
> +/* FIXME: can't break out of this unless klist_iter_exit is also
> + * called before doing the break
> + */
> +#define klist_for_each_entry(pos, head, member, iter) \
> + for (klist_iter_init(head, iter); (pos = ({ \
> + struct klist_node *n = klist_next(iter); \
> + n ? ({ klist_iter_exit(iter) ; NULL; }) : \
> + container_of(n, typeof(*pos), member);\
> + }) ) != NULL; )
> +
> +
> - spin_lock(&cont->containers_lock);
> - list_for_each_entry_safe(ic, tmp, &cont->containers, node) {
> +
> + klist_for_each_entry(ic, &cont->containers, node, &iter) {
> if (dev != ic->classdev.dev)
> continue;
> - list_del(&ic->node);
> + klist_remove(&ic->node);
> if (fn)
> fn(cont, dev, &ic->classdev);
Did you test with CONFIG_DEBUG_SLAB enabled?
I have a workaround for problems with device_for_each_child() not being
"safe", I'm trying to verify it right now, but the underlying problem is
in klist_next(), I don't have a general solution for it (it looks hard to
fix).
-- Patrick Mansfield
next prev parent reply other threads:[~2005-08-22 21:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-22 15:06 [PATCH] correct attribute_container list usage James Bottomley
2005-08-22 21:46 ` Patrick Mansfield [this message]
2005-08-22 21:59 ` James Bottomley
2005-08-22 22:14 ` Patrick Mansfield
2005-08-22 22:21 ` Patrick Mansfield
2005-08-22 22:47 ` James Bottomley
2005-08-22 23:26 ` James Bottomley
2005-08-23 0:39 ` Patrick Mansfield
2005-08-23 2:03 ` James Bottomley
2005-08-23 3:17 ` Patrick Mansfield
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=20050822214617.GA26441@us.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-scsi@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