public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: "Cameron, Steve" <Steve.Cameron@hp.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	"Miller, Mike (OS Dev)" <Mike.Miller@hp.com>,
	axboe@suse.de, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: RE: [PATCH 1/1] cciss: scsi error handling
Date: Fri, 11 Nov 2005 15:41:47 -0600	[thread overview]
Message-ID: <1131745307.3505.42.camel@mulgrave> (raw)
In-Reply-To: <45B36A38D959B44CB032DA427A6E10640A7A540D@cceexc18.americas.cpqcorp.net>

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



  reply	other threads:[~2005-11-11 21:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-11 19:38 [PATCH 1/1] cciss: scsi error handling Cameron, Steve
2005-11-11 21:41 ` James Bottomley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-11-11 22:01 Cameron, Steve
2005-11-04 18:30 mike.miller
2005-11-11 11:36 ` Jeff Garzik

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=1131745307.3505.42.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=Mike.Miller@hp.com \
    --cc=Steve.Cameron@hp.com \
    --cc=axboe@suse.de \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --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