Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionMichal Grzedzicki
2021-05-12 15:53:46 UTC
Created attachment 1782457[details]
Patch backporting upstream fix to hdparm package
Description of problem:
hdparm --dco-identify produces invalid Real max sectors output for drives with certain sizes.
Version-Release number of selected component (if applicable): hdparm-9.54-3
How reproducible:
Can be reliably reproduced on affected drives like Seagate XF1230 1920GB.
The drives need to have certain sizes to trigger the issue.
Steps to Reproduce:
1. run hdparm --dco-identify /dev/sdd
Actual results:
/dev/sdd:
DCO Checksum verified.
DCO Revision: 0x0002
The following features can be selectively disabled via DCO:
Transfer modes:
mdma0 mdma1 mdma2
udma0 udma1 udma2 udma3 udma4 udma5 udma6
Real max sectors: 18446744073165333168
ATA command/feature sets:
SMART self_test error_log security 48_bit
SATA command/feature sets:
interface_power_management SSP
Expected results:
/dev/sdd:
DCO Checksum verified.
DCO Revision: 0x0002
The following features can be selectively disabled via DCO:
Transfer modes:
mdma0 mdma1 mdma2
udma0 udma1 udma2 udma3 udma4 udma5 udma6
Real max sectors: 3750748848
ATA command/feature sets:
SMART self_test error_log security 48_bit
SATA command/feature sets:
interface_power_management SSP
Additional info:
Real max sectors value is incorrect.
calculation is using bitshift operations, if shift result value has most significant bit set it's treated as signed negative value and extended as such to 64 bit value (filled with 1-s instead of 0's).
The issue is more clear if we look at hex values.
Incorrect value:
hex(18446744073165333168) = 0xffffffffdf8fe2b0
Expected value:
hex(3750748848) = 0xdf8fe2b0
Reported and fixed upstream in https://sourceforge.net/p/hdparm/bugs/87/ (triggered the release of 9.62). Attached patch backports the upstream fix to 9.54.
Comment 1Michal Grzedzicki
2021-05-13 10:01:51 UTC
Thanks for the contribution, this is really helpful!
I've read through the patch and tried to find a drive nearby to trigger the issue, no luck so far.
Comment 9Michal Grzedzicki
2021-05-20 10:46:03 UTC
(In reply to Tomáš Bžatek from comment #5)
> Thanks for the contribution, this is really helpful!
>
> I've read through the patch and tried to find a drive nearby to trigger the
> issue, no luck so far.
Yeah it's tricky to reproduce, not many drives are in the size range triggering this, we noticed this after processing hundreds of drives.
To test it I created a reproducer based on the data caught by strace.
Comment 10Michal Grzedzicki
2021-05-20 10:47:03 UTC
(In reply to Tomáš Bžatek from comment #5)
> Thanks for the contribution, this is really helpful!
>
> I've read through the patch and tried to find a drive nearby to trigger the
> issue, no luck so far.
I have access to the hardware and can test the rpm if that helps.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (hdparm bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2021:4421