From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758218AbcLUXLe (ORCPT ); Wed, 21 Dec 2016 18:11:34 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53061 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758789AbcLUXLV (ORCPT ); Wed, 21 Dec 2016 18:11:21 -0500 Subject: Re: [PATCH] scsi: do not requeue requests unaligned with device sector size To: "Martin K. Petersen" , Christoph Hellwig , Hannes Reinecke References: <1482199347-9128-1-git-send-email-mauricfo@linux.vnet.ibm.com> Cc: jejb@linux.vnet.ibm.com, linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, gpiccoli@linux.vnet.ibm.com From: Mauricio Faria de Oliveira Date: Wed, 21 Dec 2016 21:11:09 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16122123-0032-0000-0000-000005276B4D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16122123-0033-0000-0000-000011A9AAD6 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-21_18:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1612210353 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/21/2016 05:50 AM, Christoph Hellwig wrote: > 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. On 12/21/2016 06:09 AM, Hannes Reinecke wrote: > Which actually would be pretty much my objection, too. > > This would only be applicable for 512e drives, where we _might_ end up > with a residual smaller than the physical sector size. > But that should be handled by firmware; after all, that's what the 'e' > implies, right? On 12/21/2016 12:01 PM, Martin K. Petersen wrote: > I agree with Christoph and Hannes. Some of this falls into the gray area > that's outside of the T10 spec (HBA programming interface guarantees) > but it seems like a deficiency in the HBA to report a byte count that's > not a multiple of the logical block size. A block can't be partially > written. Either it made it or it didn't. Regardless of how the I/O is > being broken up into frames at the transport level and at which offset > the transfer was interrupted. Christoph, Hannes, Martin, Thank you all for your comments and pointers to the documentation/spec. I'll carry it on with the HBA and storage folks. cheers, -- Mauricio Faria de Oliveira IBM Linux Technology Center