Skip to content

hibernate-util: drop invalid assertion#35801

Closed
yuwata wants to merge 1 commit intosystemd:mainfrom
yuwata:hibernate-util-devno
Closed

hibernate-util: drop invalid assertion#35801
yuwata wants to merge 1 commit intosystemd:mainfrom
yuwata:hibernate-util-devno

Conversation

@yuwata
Copy link
Copy Markdown
Member

@yuwata yuwata commented Jan 2, 2025

When a swap file is on a btrfs RAID, then SwapEntries.devno is zero, and the entry is ignored. Hence, even if resume= kernel command line is unspecified (thus resume_config_devno == 0), no suitable swap entry will be found, and trigger the assertion(resume_config_devno > 0).

This drops the assertion, and updates log messages. Also, checks if the found swap entry has valid devno before constructing HibernationDevice object.

Fixes #35798.

When a swap file is on a btrfs RAID, then SwapEntries.devno is zero,
and the entry is ignored. Hence, even if resume= kernel command line is
unspecified (thus resume_config_devno == 0), no suitable swap entry will
be found, and trigger the assertion(resume_config_devno > 0).

This drops the assertion, and updates log messages.
Also, checks if the found swap entry has valid devno before constructing
HibernationDevice object.

Fixes systemd#35798.
@github-actions github-actions bot added util-lib please-review PR is ready for (re-)review by a maintainer labels Jan 2, 2025
@yuwata yuwata requested a review from YHNdnzj January 2, 2025 03:46
YHNdnzj added a commit to YHNdnzj/systemd that referenced this pull request Jan 2, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801
@YHNdnzj
Copy link
Copy Markdown
Member

YHNdnzj commented Jan 2, 2025

-> #35802

@YHNdnzj YHNdnzj added replaced-by-newer-pr and removed please-review PR is ready for (re-)review by a maintainer labels Jan 2, 2025
@yuwata yuwata closed this Jan 2, 2025
@yuwata yuwata deleted the hibernate-util-devno branch January 2, 2025 04:35
YHNdnzj added a commit to YHNdnzj/systemd that referenced this pull request Jan 2, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801
YHNdnzj added a commit that referenced this pull request Jan 2, 2025
daandemeyer pushed a commit to daandemeyer/systemd that referenced this pull request Jan 7, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801

(cherry picked from commit bd3d361)
daandemeyer pushed a commit to daandemeyer/systemd that referenced this pull request Jan 7, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801

(cherry picked from commit bd3d361)
bluca pushed a commit that referenced this pull request Jan 7, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes #35798
Replaces #35801

(cherry picked from commit bd3d361)
slee649 pushed a commit to slee649/systemd that referenced this pull request Jan 7, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801
bluca pushed a commit to bluca/systemd that referenced this pull request Jan 7, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801

(cherry picked from commit bd3d361)
(cherry picked from commit 01686c3)
bluca pushed a commit to bluca/systemd that referenced this pull request Jan 7, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801

(cherry picked from commit bd3d361)
(cherry picked from commit 01686c3)
goenkam pushed a commit to goenkam/systemd that referenced this pull request Jan 8, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801
bluca pushed a commit that referenced this pull request Jan 8, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes #35798
Replaces #35801

(cherry picked from commit bd3d361)
(cherry picked from commit 01686c3)
sknsean pushed a commit to sknsean/systemd that referenced this pull request Feb 6, 2025
…cking dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes systemd#35798
Replaces systemd#35801

(cherry picked from commit bd3d361)
(cherry picked from commit 01686c3)
(cherry picked from commit a354987)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants