From: Christoph Hellwig <hch@infradead.org>
To: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Cc: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, gpiccoli@linux.vnet.ibm.com
Subject: Re: [PATCH] scsi: do not requeue requests unaligned with device sector size
Date: Tue, 20 Dec 2016 23:50:03 -0800 [thread overview]
Message-ID: <20161221075003.GA22860@infradead.org> (raw)
In-Reply-To: <1482199347-9128-1-git-send-email-mauricfo@linux.vnet.ibm.com>
On Tue, Dec 20, 2016 at 12:02:27AM -0200, Mauricio Faria de Oliveira wrote:
> When a SCSI command (e.g., read operation) is partially completed
> with good status and residual bytes (i.e., not all the bytes from
> the specified transfer length were transferred) the SCSI midlayer
> will update the request/bios with the completed bytes and requeue
> the request in order to complete the remainder/pending bytes.
>
> However, when the device sector size is greater than the 512-byte
> default/kernel sector size, alignment restrictions and validation
> apply (both to the starting logical block address, and the number
> of logical blocks to transfer) -- values must be multiples of the
> device sector size, otherwise the kernel fails the request in the
> preparation stage (e.g., sd_setup_read_write_cmnd() at sd.c file):
How do you even get an unaligned residual count? Except for SES
processor devices (which will only issue BLOCK_PC commands) this is
not allowed by SPC:
"The residual count shall be reported in bytes if the peripheral device
type in the destination target descriptor is 03h (i.e., processor device),
and in destination device blocks for all other device type codes."
next prev parent reply other threads:[~2016-12-21 7:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-20 2:02 [PATCH] scsi: do not requeue requests unaligned with device sector size Mauricio Faria de Oliveira
2016-12-20 11:45 ` Guilherme G. Piccoli
2016-12-21 7:50 ` Christoph Hellwig [this message]
2016-12-21 8:09 ` Hannes Reinecke
2016-12-21 14:01 ` Martin K. Petersen
2016-12-21 23:11 ` Mauricio Faria de Oliveira
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=20161221075003.GA22860@infradead.org \
--to=hch@infradead.org \
--cc=gpiccoli@linux.vnet.ibm.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mauricfo@linux.vnet.ibm.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).