Direct I/O with the hdd stressor with random I/O and non power of 2 stressors causes errno -22 EINVAL write errors

Bug #1951152 reported by Colin Ian King
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
stress-ng (Ubuntu)
Fix Released
Medium
Colin Ian King
Bionic
Fix Released
Medium
Colin Ian King
Focal
Fix Released
Medium
Colin Ian King
Hirsute
Fix Released
Medium
Colin Ian King
Impish
Fix Released
Medium
Colin Ian King
Jammy
Fix Released
Medium
Colin Ian King

Bug Description

== SRU Justification ==

[IMPISH][HIRSUTE][FOCAL][BIONIC]

[ The issue ]

Turns out the math is incorrect in calculating the offset into a file on direct I/O writes cause non-block aligned offsets that cause -EINVAL on writes. This can occur when running non-power of two number of hdd stressors, e.g. 5 stressors.

[ The fix ]

Upstream fix:

From 9bbe45dfbd5db48c658dd0cf1f28cdb847bcee9c Mon Sep 17 00:00:00 2001
From: Colin Ian King <email address hidden>
Date: Thu, 11 Nov 2021 13:11:27 +0000
Subject: [PATCH] stress-hdd: ensure offset is aligned to 512 byte boundary

Fix corrects rounds to the 512 byte boundary on offsets.

See: https://github.com/ColinIanKing/stress-ng/issues/158

[ Test plan ]

stress-ng --hdd 5 --hdd-write-size 512 --hdd-bytes 2M --hdd-opts direct,sync,wr-rnd,rd-rnd --timeout 0 --verbose

Without the fix the test exits early with a invalid write failure error. With the fix the test will run forever.

[ Where problems could occur ]

This fix only affects the hdd stressor test with random I/O writes AND direct I/O. The fix aligns the random offset, so in effect the change won't affect the overall test behaviour except for fixing the offsets so they are always naturally block aligned. This does mean that the stressor will do writes that are no longer spanned over multiple blocks (which is a valid test case), so the test case is less effective, but it is now at least working for direct I/O cases.

Changed in stress-ng:
assignee: nobody → Colin Ian King (colin-king)
status: New → In Progress
importance: Undecided → Low
description: updated
description: updated
no longer affects: stress-ng
Changed in stress-ng (Ubuntu):
assignee: nobody → Colin Ian King (colin-king)
importance: Undecided → Medium
status: New → In Progress
description: updated
Changed in stress-ng (Ubuntu Jammy):
status: In Progress → Fix Released
Changed in stress-ng (Ubuntu Impish):
status: New → In Progress
Changed in stress-ng (Ubuntu Hirsute):
status: New → In Progress
Changed in stress-ng (Ubuntu Focal):
status: New → In Progress
Changed in stress-ng (Ubuntu Bionic):
status: New → In Progress
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Colin, or anyone else affected,

Accepted stress-ng into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.13.04-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in stress-ng (Ubuntu Impish):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-impish
Changed in stress-ng (Ubuntu Hirsute):
status: In Progress → Fix Committed
tags: added: verification-needed-hirsute
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Colin, or anyone else affected,

Accepted stress-ng into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.12.06-1ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in stress-ng (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Colin, or anyone else affected,

Accepted stress-ng into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.11.07-1ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in stress-ng (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Colin, or anyone else affected,

Accepted stress-ng into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.09.25-1ubuntu9 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Colin Ian King (colin-king) wrote :

Verified on stress-ng 0.13.04-1ubuntu1 for impish

Changed in stress-ng (Ubuntu Impish):
assignee: nobody → Colin Ian King (colin-king)
Changed in stress-ng (Ubuntu Hirsute):
assignee: nobody → Colin Ian King (colin-king)
Changed in stress-ng (Ubuntu Focal):
assignee: nobody → Colin Ian King (colin-king)
Changed in stress-ng (Ubuntu Bionic):
assignee: nobody → Colin Ian King (colin-king)
tags: added: verification-done-impish
removed: verification-needed-impish
Revision history for this message
Colin Ian King (colin-king) wrote :

Verified on stress-ng 0.12.06-1ubuntu2 for hirsute

tags: added: verification-fixed-hirsute
removed: verification-needed-hirsute
Changed in stress-ng (Ubuntu Impish):
importance: Undecided → Medium
Changed in stress-ng (Ubuntu Hirsute):
importance: Undecided → Medium
Changed in stress-ng (Ubuntu Focal):
importance: Undecided → Medium
Changed in stress-ng (Ubuntu Bionic):
importance: Undecided → Medium
Revision history for this message
Colin Ian King (colin-king) wrote :

Verified on stress-ng 0.11.07-1ubuntu2

tags: added: verification-fixed-focal
removed: verification-needed-focal
tags: added: verification-done-focal verification-done-hirsute
removed: verification-fixed-focal verification-fixed-hirsute
Revision history for this message
Colin Ian King (colin-king) wrote :

Verified on stress-ng 0.09-25-1ubuntu9

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package stress-ng - 0.13.04-1ubuntu1

---------------
stress-ng (0.13.04-1ubuntu1) impish; urgency=medium

  * stress-hdd: ensure offset is aligned to 512 byte boundary (LP: #1951152)
    fixes direct I/O random write failures with the hdd stressor

 -- Colin Ian King <email address hidden> Tue, 16 Nov 2021 18:23:12 +0000

Changed in stress-ng (Ubuntu Impish):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for stress-ng has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package stress-ng - 0.12.06-1ubuntu2

---------------
stress-ng (0.12.06-1ubuntu2) hirsute; urgency=medium

  * stress-hdd: ensure offset is aligned to 512 byte boundary (LP: #1951152)
    fixes direct I/O random write failures with the hdd stressor

 -- Colin Ian King <email address hidden> Tue, 16 Nov 2021 19:19:19 +0000

Changed in stress-ng (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package stress-ng - 0.11.07-1ubuntu2

---------------
stress-ng (0.11.07-1ubuntu2) focal; urgency=medium

  * stress-hdd: ensure offset is aligned to 512 byte boundary (LP: #1951152)
    fixes direct I/O random write failures with the hdd stressor

 -- Colin Ian King <email address hidden> Tue, 16 Nov 2021 19:31:29 +0000

Changed in stress-ng (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package stress-ng - 0.09.25-1ubuntu9

---------------
stress-ng (0.09.25-1ubuntu9) bionic; urgency=medium

  * stress-hdd: ensure offset is aligned to 512 byte boundary (LP: #1951152)
    fixes direct I/O random write failures with the hdd stressor

 -- Colin Ian King <email address hidden> Tue, 16 Nov 2021 19:38:41 +0000

Changed in stress-ng (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.