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: Wed, 28 Apr 2021 22:54:55 +0200 [thread overview]
Message-ID: <3719d0b8ab39d1008030e8f4e462fb4ee98952ac.camel@suse.com> (raw)
In-Reply-To: <20210428195457.GA46518@lobo>
On Wed, 2021-04-28 at 15:54 -0400, Mike Snitzer wrote:
>
> Ngh... not loving this at all.
I'm not surprised :-) I infer from your reply that you acknowledge this
is something that should be done one way or the other, and I'm glad
about that.
> But here is a patch (that I didn't
> compile test) that should be folded in, still have to think about how
> this could be made cleaner in general though.
Thanks, much appreciated.
> Also, dm_sg_io_ioctl should probably be in dm-rq.c (maybe even dm-
> mpath.c!?)
>
> From: Mike Snitzer <snitzer@redhat.com>
> Date: Wed, 28 Apr 2021 15:03:20 -0400
> Subject: [PATCH] dm: use scsi_result_to_blk_status rather than open-
> coding it
>
> Other small cleanups/nits.
>
> BUT the fact that dm.c now #includes <scsi/scsi.h> and <scsi/sg.h>
> leaves a very bitter taste.
>
> Also, hardcoding the issuing of a "fail_path" message (assumes tgt is
> dm-mpath) but still having checks like !tgt->type->message.. its all
> very contrived and awkward!
This I can explain. I need to check t->type->message because not all
targets define it. If I didn't, yet used message(), the kernel might
crash. I would have avoided the hard-coded "fail_path", too, if I had
found a way to figure out which messages a given target supports, or
whether the target in question is the multipath target in the first
place. But I couldn't figure it out. If it's possible, please tell me
how.
Wrt "fail_path", the assumption is that other rq-based targets would
either not support "fail_path" and thus return an error, or implement
it with the same semantics as multipath. In both cases, my patch would
do the "right thing" (falling back to standard behavior in the error
case).
Thanks,
Martin
next prev parent reply other threads:[~2021-04-28 20:54 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 [this message]
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
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=3719d0b8ab39d1008030e8f4e462fb4ee98952ac.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