All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: James Bottomley <James.Bottomley@suse.de>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] make error handling robust in the face of reservations
Date: Fri, 6 Aug 2010 14:56:55 -0600	[thread overview]
Message-ID: <20100806205655.GM27935@parisc-linux.org> (raw)
In-Reply-To: <1281125844.6245.109.camel@mulgrave.site>

On Fri, Aug 06, 2010 at 03:17:24PM -0500, James Bottomley wrote:
> There's a curious case where devices in clusters are offlining if they
> go into error handling.  The reason is that in this particular cluster,
> Test Unit Ready gets a RESERVATION CONFLICT return when another node
> owns the storage.  This means that all TURs that error handling use are
> marked failed, so we always assume the device is unrecoverable and take
> it offline.
> 
> Fix this by checking in the error handling code processing returns to
> see if the command was a TUR and translate the EH return to SUCCESS
> (after all, if the target managed to return RESERVATION CONFLICT, we've
> successfully made contact with it).

Um, the patch doesn't match the description.  According to the code,
we were unconditionally returning SUCCESS before.  Now we fail everythng
except TUR.  Was there another part to this patch, or is the description
bonkers?

> ---
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 2bf9846..5e2d36f 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -473,10 +473,12 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd)
>  		 */
>  		return SUCCESS;
>  	case RESERVATION_CONFLICT:
> -		/*
> -		 * let issuer deal with this, it could be just fine
> -		 */
> -		return SUCCESS;
> +		if (scmd->cmnd[0] == TEST_UNIT_READY)
> +			/* it is a success, we probed the device and
> +			 * found it */
> +			return SUCCESS;
> +		/* otherwise, we failed to send the command */
> +		return FAILED;
>  	case QUEUE_FULL:
>  		scsi_handle_queue_full(scmd->device);
>  		/* fall through */
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2010-08-06 20:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06 20:17 [PATCH] make error handling robust in the face of reservations James Bottomley
2010-08-06 20:56 ` Matthew Wilcox [this message]
2010-08-06 21:02   ` James Bottomley

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=20100806205655.GM27935@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=James.Bottomley@suse.de \
    --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 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.