Bug 1971877
| Summary: | mkswap some-file gets stuck | |||
|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Brian Lane <bcl> | |
| Component: | util-linux | Assignee: | Karel Zak <kzak> | |
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 35 | CC: | jonathan, kzak | |
| Target Milestone: | --- | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1971989 (view as bug list) | Environment: | ||
| Last Closed: | 2022-12-13 15:25:11 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1971989 | |||
|
Description
Brian Lane
2021-06-14 21:20:20 UTC
If I switch it to using 'dd if=/dev/zero of=loop-file bs=1M count=1' instead of /dev/null it doesn't get stuck so it appears to be related to having a file that's just one big hole. A later use of mkswap on a file created with dd.../dev/null also doesn't fail because (I think) the file is written to before the mkswap is run on it (parted test t9050). Result of the bisection:
95025c29e2ae7b1b203fb18d57509f675e924cd is the first bad commit
commit 195025c29e2ae7b1b203fb18d57509f675e924cd
Author: Karel Zak <kzak>
Date: Wed Sep 9 11:00:40 2020 +0200
mkswap: check for holes and unwanted extentd in file
Let's make mkswap(8) more user-friend and report possible swapon
issues already when user initialize a swap file. The extents check
produces warnings, no exit with error.
# dd if=/dev/zero of=img count=100 bs=1MiB
# chmod 0600 img
# fallocate --dig-hole --offset 64520192 --length 1MiB img
# fallocate --dig-hole --offset 84520960 --length 1MiB img
# ./mkswap img
mkswap: extents check failed:
- hole detected at offset 64520192 (size 1048576 bytes)
- hole detected at offset 84520960 (size 1048576 bytes)
file img can be rejected by kernel on swap activation.
Setting up swapspace version 1, size = 100 MiB (104853504 bytes)
no label, UUID=92091112-26b5-47aa-a02a-592e52528319
It checks for holes in the file, and for unknown, inline, shared and
deallocated extents.
Addresses: https://github.com/karelzak/util-linux/issues/1120
Signed-off-by: Karel Zak <kzak>
configure.ac | 1 +
disk-utils/mkswap.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 95 insertions(+), 2 deletions(-)
Fixed by upstream commit 8a3a74160b96498d672e3652827aa7e6d7f3a120. The change will be available in v2.37.1. This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle. Changing version to 35. This message is a reminder that Fedora Linux 35 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '35'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 35 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13. Fedora Linux 35 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed. |