All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arne Redlich <arne.redlich@xiranet.com>
To: Hannes Reinecke <hare@suse.de>
Cc: michaelc@cs.wisc.edu, dm-devel@redhat.com,
	Alasdair Kergon <agk@redhat.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 2/3] multipath: Add new SPC-3 ALUA hardware handler
Date: Fri, 16 Nov 2007 11:25:38 +0100	[thread overview]
Message-ID: <8764021o7x.fsf@confield.dd.xiranet.com> (raw)
In-Reply-To: <20071115091634.4568D347401@pentland.suse.de> (Hannes Reinecke's message of "Thu\, 15 Nov 2007 10\:16\:34 +0100")

Hi Hannes,

hare@suse.de (Hannes Reinecke) writes:

> This adds a new SPC-3 ALUA hardware handler for multipathing.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>

<snip>

> +#define TPGS_STATE_OPTIMIZED		0x0
> +#define TPGS_STATE_NONOPTIMIZED		0x1
> +#define TPGS_STATE_STANDBY		0x2
> +#define TPGS_STATE_UNAVAILABLE		0x3
> +#define TPGS_STATE_OFFLINE		0xe

SPC-3 (at least the draft, rev 23 I'm looking at) doesn't know an
'Offline' state - I think it's a SPC-4 feature. So maybe 'Unavailable'
should be interpreted as path failure as well / instead?

<snip>

> +/*
> + * SET TARGET GROUP STATES endio handler
> + *
> + * We only have to test here if we should resubmit the command;
> + * any other error is assumed as a failure.
> + * Maybe we should analyze the sensebuffer here, too.
> + */
> +static void stpg_endio(struct request *req, int error)
> +{
> +	struct hw_handler *hwh = req->end_io_data;
> +	struct alua_handler *h = hwh->context;
> +
> +	switch(host_byte(error)) {
> +	case DID_BUS_BUSY:
> +		if (!h->retry)
> +			break;
> +		h->retry--;
> +	case DID_REQUEUE:
> +	case DID_IMM_RETRY:
> +		dm_enqueue_hw_workq(hwh);
> +		goto done;
> +	}
> +
> +	if (had_failures(req, error)) {
> +		if (h->tpgs & TPGS_MODE_IMPLICIT) {
> +			/* Ignore errors; the array will figure it out */
> +			DMWARN("%s: stpg failed %x, disabling explicit mode",
> +			       h->path->dev->name, error);
> +			h->tpgs &= ~TPGS_MODE_EXPLICIT;
> +			dm_enqueue_hw_workq(hwh);
> +		} else {
> +			DMWARN("%s: stpg failed %x, disable path",
> +			       h->path->dev->name, error);
> +			dm_pg_init_complete(h->path, MP_FAIL_PATH);
> +		}
> +	} else {
> +		DMWARN("%s: port group %02x new state %c",
> +		       h->path->dev->name, h->group_id,
> +		       print_alua_state(h->state) );
> +		dm_pg_init_complete(h->path, 0);

Hmmm, maybe I'm just missing something so CMIIW, but I think the PG
state should be retrieved once more before finally calling
dm_pg_init_complete(), because the target might return the STPG command
before the transition has completed (SPC-3, 6.31). This could confuse
application clients?

Arne

  reply	other threads:[~2007-11-16 10:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-15  9:16 [PATCH 2/3] multipath: Add new SPC-3 ALUA hardware handler Hannes Reinecke
2007-11-16 10:25 ` Arne Redlich [this message]
2007-11-16 11:36   ` Hannes Reinecke

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=8764021o7x.fsf@confield.dd.xiranet.com \
    --to=arne.redlich@xiranet.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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.