Skip to content

Conversation

@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Jun 7, 2025

While working on https://issues.redhat.com/browse/RHEL-81042, I found out that podman-update(1) man page contains an example which uses /dev/zero instead of a block device. I also found out that it is working on some systems and not on others.

What happens is, if a non-block device is specified, the major:minor numbers from it are used to set weight and throttle limits (iops/bps) for a block device with the same major:minor pair. This does not make any sense.

  • Add a check that the supplied device path is indeed of a block device.
  • Add an integration test for podman update.
  • Fix the man page accordingly.

Can be seen as a continuation of #26022.

Does this PR introduce a user-facing change?

Options `--blkio-weight-device`, `--device-read-bps`, `--device-write-bps`, `--device-read-iops`, `--device-write-iops` no longer accept non-block devices.

@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this seems similar to #26022

Can you add a test case for update that adding a char device such as /dev/zero raises an error now?

Refactor these functions to
 - avoid repetition of common code (mostly stat of block device path);
 - perform early return if nothing is to be done;
 - remove some excessive nesting.

It also improves some error messages.

This is a preparation for the next commit.

Signed-off-by: Kir Kolyshkin <[email protected]>
In case something other than a block device is supplied, podman proceeds
to apply settings for a block device with the same minor:major.

For example, "--blkio-weight-device /dev/zero:123" (alas, this is taken
literally from podman-update(1) EXAMPLES section) sets blkio weight
for /dev/ram5. Instead, it should error out since /dev/zero is not a
block device.

Add an appropriate check.

Signed-off-by: Kir Kolyshkin <[email protected]>
This is a test case for an issue fixed by the previous commit.

Signed-off-by: Kir Kolyshkin <[email protected]>
Mainly this fixes an issue of using /dev/zero for block device examples.

Also:
 * fix section title;
 * remove separate cgroup v2 and v1 examples, only leaving one;
 * break long lines.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

Thanks this seems similar to #26022

Indeed, it finishes what the #26022 started.

Can you add a test case for update that adding a char device such as /dev/zero raises an error now?

Done.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2025
@kolyshkin
Copy link
Contributor Author

Anything I need to do to move it forward?

@Luap99
Copy link
Member

Luap99 commented Jun 16, 2025

@containers/podman-maintainers PTAL

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 16, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, kolyshkin, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit f235d47 into containers:main Jun 16, 2025
76 of 77 checks passed
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 15, 2025
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Sep 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants