Re: [PATCH] correct attribute_container list usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux