RE: [PATCH 1/1] cciss: scsi error handling

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

 



On Fri, 2005-11-11 at 13:38 -0600, Cameron, Steve wrote:
> About the locking first,
> 
> So, there's one part that I was a little worried about, where
> it does this in a couple places:
> 
>         c = (ctlr_info_t **) &scsicmd->device->host->hostdata[0];
> 
> (gets our adapter structure by following pointers in the scsi
> command)
> 
> So, if that pointer chain can change suddenly, then my code is bad.
> 
> Can doing "echo scsi remove-single-device . . . > /proc/scsi/scsi"
> cause that pointer chain to break?  I noticed I can yank a disk
> out from under a mounted filesystem with 
> "echo scsi remove-single-device"  It wasn't obvious to me whether
> doing that would affect that pointer chain though, though I could
> imagine it might.
> 
> Or am I barking up the wrong tree worrying about 
> the scsicmd->device->host->hostdata pointer chain
> getting yanked out from under me?

No, the pointers are all held in place.  Even if everyone else releases
their references, the commmand still contains a reference to the device
(which holds it from being released) and the device likewise contains a
reference to the host.

James


-
: 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