All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junichi Nomura <j-nomura@ce.jp.nec.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>,
	device-mapper development <dm-devel@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>
Subject: Re: [PATCH for-4.2 2/3] block, dm: don't copy bios for request clones
Date: Wed, 3 Jun 2015 23:13:09 +0000	[thread overview]
Message-ID: <556F8A05.70706@ce.jp.nec.com> (raw)
In-Reply-To: <20150603073725.GA12072@lst.de>

On 06/03/15 16:37, Christoph Hellwig wrote:
> From scsi_io_completion:
> 
> 	/*
> 	 * If we finished all bytes in the request we are done now.
> 	 */
> 	if (!scsi_end_request(req, error, good_bytes, 0))
> 		return;
> 
> 	/*
> 	 * Kill remainder if no retrys.
> 	 */
> 	if (error && scsi_noretry_cmd(cmd)) {
> 		if (scsi_end_request(req, error, blk_rq_bytes(req), 0))
> 			BUG();
> 		return;
> 	}
> 
> So for a noretry command send from dm-mpath we will never leave a command
> that had an error completion around, even if it was a partial completion.

scsi_noretry_cmd() is not always true even for dm-mpath.

Following code in the later part of the function tries to complete
some bytes with error and requeue the remainder.
However it depends on blk_rq_err_bytes() whether partial error completion
actually happens...

        case ACTION_FAIL:
                ...
                if (!scsi_end_request(req, error, blk_rq_err_bytes(req), 0))
                        return;
                /*FALLTHRU*/
        case ACTION_REPREP:
        requeue:
                /* Unprep the request and put it back at the head of the queue.
                 * A new command will be prepared and issued.
                 */
                if (q->mq_ops) {
                        cmd->request->cmd_flags &= ~REQ_DONTPREP;
                        scsi_mq_uninit_cmd(cmd);
                        scsi_mq_requeue_cmd(cmd);
                } else {
                        scsi_release_buffers(cmd);
                        scsi_requeue_command(q, cmd);
                }

> Relying on the LLDDs to get this right seems rather dangerous, though, so
> it might make sense to lift the above sequence to core code after a careful
> audit of other drivers to see if and how they handle partial completions.

Right, that is the point.

-- 
Jun'ichi Nomura, NEC Corporation

  reply	other threads:[~2015-06-03 23:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 13:14 [PATCH for-4.2 1/3] block: remove management of bi_remaining when restoring original bi_end_io Mike Snitzer
2015-05-22 13:14 ` [PATCH for-4.2 2/3] block, dm: don't copy bios for request clones Mike Snitzer
2015-05-26  6:20   ` Junichi Nomura
2015-05-27  8:21     ` Christoph Hellwig
2015-05-27  9:50       ` Junichi Nomura
2015-05-28  6:38         ` Junichi Nomura
2015-05-29 16:54           ` Christoph Hellwig
2015-06-01  1:14             ` Junichi Nomura
2015-06-03  7:37               ` Christoph Hellwig
2015-06-03 23:13                 ` Junichi Nomura [this message]
2015-05-29 16:55         ` Christoph Hellwig
2015-06-01  1:19           ` Junichi Nomura
2015-06-03  7:39             ` Christoph Hellwig
2015-05-22 13:14 ` [PATCH for-4.2 3/3] block: remove export for blk_queue_bio Mike Snitzer

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=556F8A05.70706@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    --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 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.