linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: Alasdair G Kergon <agk@redhat.com>,
	dm-devel@redhat.com, Hannes Reinecke <hare@suse.de>,
	Daniel Wagner <dwagner@suse.de>,
	linux-block@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Christoph Hellwig <hch@lst.de>,
	linux-scsi@vger.kernel.org
Subject: Re: dm: dm_blk_ioctl(): implement failover for SG_IO on dm-multipath
Date: Thu, 29 Apr 2021 10:33:09 +0200	[thread overview]
Message-ID: <26ac367a5a09ff5de628717721425fbc03018f44.camel@suse.com> (raw)
In-Reply-To: <20210428195457.GA46518@lobo>

On Wed, 2021-04-28 at 15:54 -0400, Mike Snitzer wrote:
> 
> @@ -626,32 +626,16 @@ static int dm_sg_io_ioctl(struct block_device
> *bdev, fmode_t mode,
>                 }
>  
>                 if (rhdr.info & SG_INFO_CHECK) {
> -                       /*
> -                        * See if this is a target or path error.
> -                        * Compare blk_path_error(),
> scsi_result_to_blk_status(),
> -                        * blk_errors[].
> -                        */
> -                       switch (rhdr.host_status) {
> -                       case DID_OK:
> -                               if (scsi_status_is_good(rhdr.status))
> -                                       rc = 0;
> -                               break;
> -                       case DID_TARGET_FAILURE:
> -                               rc = -EREMOTEIO;
> -                               goto out;
> -                       case DID_NEXUS_FAILURE:
> -                               rc = -EBADE;
> -                               goto out;
> -                       case DID_ALLOC_FAILURE:
> -                               rc = -ENOSPC;
> -                               goto out;
> -                       case DID_MEDIUM_ERROR:
> -                               rc = -ENODATA;
> -                               goto out;
> -                       default:
> -                               /* Everything else is a path error */
> +                       blk_status_t sts =
> scsi_result_to_blk_status(rhdr.host_status, NULL);

This change makes dm_mod depend on scsi_mod. 
Would you seriously prefer that over a re-implementation of the logic?

Regards
Martin



  parent reply	other threads:[~2021-04-29  8:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 20:21 [PATCH] dm: dm_blk_ioctl(): implement failover for SG_IO on dm-multipath mwilck
2021-04-22 20:24 ` [*RFC* PATCH] " Martin Wilck
2021-04-28 19:54 ` Mike Snitzer
2021-04-28 20:54   ` Martin Wilck
2021-04-29  6:02   ` Hannes Reinecke
2021-04-30 20:15     ` Mike Snitzer
2021-05-03  7:27       ` Martin Wilck
2021-04-29  8:33   ` Martin Wilck [this message]
2021-04-29  8:39     ` Paolo Bonzini

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=26ac367a5a09ff5de628717721425fbc03018f44.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=snitzer@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).