All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: open-iscsi@googlegroups.com,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: question about sd_sync_cache and shutdown
Date: Tue, 11 Jul 2006 19:57:45 -0500	[thread overview]
Message-ID: <44B44909.1000703@cs.wisc.edu> (raw)

Currently, if we remove a host, target, transport object like session or
rport or scsi_device sd_shutdown will get called but
scsi_disk_get_from_dev will return NULL and we hit this return statement

static void sd_shutdown(struct device *dev)
{
        struct scsi_device *sdp = to_scsi_device(dev);
        struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);

        if (!sdkp)
                return;         /* this can happen */

The reason is that __scsi_remove_device calls scsi_device_set_state and
sets the state to SDEV_CANCEL then it calls device_del. then when
scsi_disk_get_from_dev is called in sd.c it eventually calls
scsi_device_get which checks if the state is SDEV_CANCEL and it so
returns NULL.

My question is if this a bug or expected behavior? It seems like a bug
because for a orderly removal of some object, like someone shutting down
a iscsi session, we are going to hit that path, but the command will not
get sent. However, for unorderly removal, like ripping out a usb device
or FC rport or iSCSI session being removed due to dev_loss_tmp expiring
then we do not want the command sent. So it seems like it may be
intended behavior.


             reply	other threads:[~2006-07-12  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12  0:57 Mike Christie [this message]
2006-07-12 16:25 ` question about sd_sync_cache and shutdown Stefan Richter
2006-07-12 16:41   ` Mike Christie
2006-07-12 18:49     ` Stefan Richter
2006-07-12 19:18       ` Stefan Richter

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=44B44909.1000703@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=linux-scsi@vger.kernel.org \
    --cc=open-iscsi@googlegroups.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.