Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run: fix GetList return empty issue for throttledevice #5323

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

jongwu
Copy link
Contributor

@jongwu jongwu commented Aug 7, 2024

Test "--device-read-bps" "--device-write-bps" will fail. The root cause is that GetList helper return empty as its local variable initialized to zero size.

- What I did
This patch fix it by setting the related slice size to non-zero.

- How to verify it
docker run --device-read-bps /dev/sda2:10M busybox sh -c 'dd if=/dev/zero of=/tmp.img bs=10M count=10 oflag=direct conv=fsync'

- Description for the changelog

Fix `--device-read-bps` and `--device-write-bps` options not taking effect.

Test "--device-read-bps" "--device-write-bps" will fail. The root
cause is that GetList helper return empty as its local variable
initialized to zero size.

This patch fix it by setting the related slice size to non-zero.

Signed-off-by: Jianyong Wu <[email protected]>
Fixes: docker#5321
@jongwu jongwu changed the title gitrun: fix GetList return empty issue for throttledevice run: fix GetList return empty issue for throttledevice Aug 7, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 61.45%. Comparing base (78de7da) to head (73e78a5).
Report is 12 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5323   +/-   ##
=======================================
  Coverage   61.45%   61.45%           
=======================================
  Files         299      299           
  Lines       20855    20855           
=======================================
  Hits        12816    12816           
  Misses       7124     7124           
  Partials      915      915           

@thaJeztah
Copy link
Member

Doh! Nice catch. Looks like I introduced this in d0dee3c (d0dee3c#diff-5aaad03b8a6ef733357accbdeb0346dcad3b83c0a460b25c77ad83b726244a75R96)

Ironically, that was to enable more linters, and the linters didn't complain on this one! 🙈

@thaJeztah thaJeztah added this to the 28.0.0 milestone Aug 9, 2024
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'--device-read-bps' '--device-write-bps' does not work
3 participants