From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758170AbYG2R7R (ORCPT ); Tue, 29 Jul 2008 13:59:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752743AbYG2R7C (ORCPT ); Tue, 29 Jul 2008 13:59:02 -0400 Received: from moutng.kundenserver.de ([212.227.126.188]:58105 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690AbYG2R7B (ORCPT ); Tue, 29 Jul 2008 13:59:01 -0400 Subject: Re: Subtle but oops causing problem with class_device->device conversion From: Kay Sievers To: James Bottomley Cc: Hannes Reinecke , linux-scsi , linux-kernel In-Reply-To: <1217353348.6103.20.camel@localhost.localdomain> References: <1217353348.6103.20.camel@localhost.localdomain> Content-Type: text/plain Date: Tue, 29 Jul 2008 19:59:48 +0200 Message-Id: <1217354388.31362.2.camel@linux.site> Mime-Version: 1.0 X-Mailer: Evolution 2.23.4 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1+nmyAK7Nu+AoPH2bvKl+4buDFMjXSJZP1PrZv 8etcbKEn4lZNrSfPBoisj421/yqBXVsgpWnJiVGhscIIRx2xyk /+mHKA9ZfXVFqxuzGjIxRw5aNz2yo6B Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2008-07-29 at 12:42 -0500, James Bottomley wrote: > It's taken me a while to track this down. Basically there's an oops in > scsi_transport_spi that's directly caused by this. > > What happened is that you made all class devices become real devices and > be parented to devices they were formerly allied to through the class > device dev pointer. This means that effectively you expanded the child > list of every device to include not only its real children but also its > class devices. > > This breaks in device_for_each_child *if* the routine in the iterator > doesn't perform checks on the devices it gets back (scsi_transport_spi > was assuming that every device it got was embedded in a struct > scsi_device because they're the only logical children of a scsi_target). > > I can fix the SCSI breakage, but the whole tree will need auditing to > check that nothing else is using this assumption. I guess it's caused by: [SCSI] add scsi_host and scsi_target to scsi_bus This patch implements scsi_host and scsi_target device types and adds both to the scsi_bus. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b0ed43360fdca227048d88a08290365cb681c1a8 and not by the re-parenting, so it should be limited to SCSI, right? Thanks, Kay