All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@lst.de>,
	James Bottomley <jbottomley@odin.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/5] scsi: make scsi_eh_scmd_add() always succeed
Date: Thu, 3 Dec 2015 17:51:58 +0100	[thread overview]
Message-ID: <20151203165158.GB14775@lst.de> (raw)
In-Reply-To: <1449127063-94512-3-git-send-email-hare@suse.de>

On Thu, Dec 03, 2015 at 08:17:40AM +0100, Hannes Reinecke wrote:
> scsi_eh_scmd_add() currently only will fail if no
> error handler thread is started (which will never be the
> case) or if the state machine encounters an illegal transition.
> 
> But if we're encountering an invalid state transition
> chances is we cannot fixup things with the error handler.
> So better add a WARN_ON for illegal host states and
> make scsi_dh_scmd_add() a void function.

The ehandler parts looks trivially correct, but I'm a little worried
about the state transition.  The states that we can't transition from
are: SHOST_CREATED, SHOST_DEL and SHOST_DEL_RECOVERY.

We initialize the state to SHOST_CREATED in scsi_host_alloc and
transition away from it in scsi_add_host_with_dma, so that's a true
"should be impossible" condition.

We transition to SHOST_DEL or SHOST_DEL_RECOVERY in scsi_remove_host
and the host remains in it until the final reference is dropped. Given
that we wait for all pending I/O in blk_cleanup_queue called from
__scsi_remove_device this should be fine as well.

So:

Reviewed-by: Christoph Hellwig <hch@lst.de>

But preferably with an updated changelog that explains things better.

  parent reply	other threads:[~2015-12-03 16:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03  7:17 [PATCH 0/5] SCSI EH cleanup Hannes Reinecke
2015-12-03  7:17 ` [PATCH 1/5] libsas: allow async aborts Hannes Reinecke
2015-12-03  8:17   ` Johannes Thumshirn
2015-12-03  7:17 ` [PATCH 2/5] scsi: make scsi_eh_scmd_add() always succeed Hannes Reinecke
2015-12-03  9:07   ` Johannes Thumshirn
2015-12-03 16:51   ` Christoph Hellwig [this message]
2015-12-03  7:17 ` [PATCH 3/5] scsi: make eh_eflags persistent Hannes Reinecke
2015-12-03  9:08   ` Johannes Thumshirn
2015-12-03 16:55   ` Christoph Hellwig
2015-12-03  7:17 ` [PATCH 4/5] scsi: make asynchronous aborts mandatory Hannes Reinecke
2015-12-03  9:13   ` Johannes Thumshirn
2015-12-03  7:17 ` [PATCH 5/5] scsi_error: do not escalate failed EH command Hannes Reinecke
2015-12-03  9:15   ` Johannes Thumshirn
  -- strict thread matches above, loose matches on Subject: below --
2016-06-20  9:35 [PATCH 0/5] SCSI EH cleanup Hannes Reinecke
2016-06-20  9:35 ` [PATCH 2/5] scsi: make scsi_eh_scmd_add() always succeed Hannes Reinecke
2016-06-22 13:28   ` Christoph Hellwig

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=20151203165158.GB14775@lst.de \
    --to=hch@lst.de \
    --cc=hare@suse.de \
    --cc=jbottomley@odin.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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.