Direct I/O with the hdd stressor with random I/O and non power of 2 stressors causes errno -22 EINVAL write errors
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]
[ 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 9bbe45dfbd5db48
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:/
[ Test plan ]
stress-ng --hdd 5 --hdd-write-size 512 --hdd-bytes 2M --hdd-opts direct,
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 |
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/ PerformingSRUVe rification . 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.