lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR04MB5816F39A6F073D77499B8D85E7D20@BYAPR04MB5816.namprd04.prod.outlook.com>
Date:   Tue, 13 Aug 2019 03:47:09 +0000
From:   Damien Le Moal <Damien.LeMoal@....com>
To:     "Martin K. Petersen" <martin.petersen@...cle.com>,
        Justin Piszcz <jpiszcz@...idpixels.com>
CC:     'LKML' <linux-kernel@...r.kernel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>
Subject: Re: 5.2.x kernel: WD 8TB USB Drives: Unaligned partial completion
 (resid=78, sector_sz=512)

On 2019/08/12 19:12, Martin K. Petersen wrote:
> 
> Justin,
> 
>>> Attached 2 x brand new Western Digital 8TB USB 3.0 drives awhile back
>>> and ran some file copy tests and was getting these warnings-- is
>>> there any way to avoid these warnings?  I did confirm with parted
>>> that the partition was aligned but this appears to be something
>>> related to the firmware on the device according to [1] and [2]?
> 
>> sg_vpd_bdc.txt
>> Block device characteristics VPD page (SBC):
>>   Nominal rotation rate: 5400 rpm
>>   Product type: Not specified
>>   WABEREQ=0
>>   WACEREQ=0
>>   Nominal form factor: 3.5 inch
>>   ZONED=0
> 
> Damien: What can we do to limit the messages in cases like this? Would
> it make sense to make the residual warning conditional on sd_is_zoned()?
> 

These WD drives are regular disks, not SMR. Making the warning conditional on
sd_is_zoned() will not reduce the amount of messages. REPORT ZONES is the only
command that could result in a resid not being aligned to the block size since
by definition the command reply is composed of 64B zone descriptors. But that
command is now processed through a device method and is not a REQ_OP_XXX
anymore, so as an internal req, it does not go through sd_done() for completion
right ? All other zone commands either have no buffer, or the exact same
requirement as regular disks, expecting a block aligned resid. So I think that
using sd_is_zoned() is not relevant to this problem.

Bottom line: this USB adapter is weird and likely triggers all the unaligned
resid. I do get regularly reports of similar problem with SAS HBAs, all always
fixed with HBA FW updates. Not sure if there is a FW available for these drives.
I will ask internally.

In the mean time, rate limiting or removing the sd_printk() call may be the only
option. Failing all commands with an invalid resid would be safer I guess, but
will at best likely cause a lot of retry on these buggy devices, and break the
drive operation/perfomance completely in the worst case.

Or the usb mass storage device driver could add some silent forced resid
alignment too.

Best regards.

-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ