Bug 2083789

Summary: Option --si doesn't switch from default --kibi to --kilo.
Product: [Fedora] Fedora Reporter: r3obh <Robert.Harley>
Component: procps-ngAssignee: Jan Rybar <jrybar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: jaromir.capik, jrybar, kdudka
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: procps-ng-3.3.17-7.fc38 procps-ng-3.3.17-4.fc36.1 procps-ng-3.3.17-6.fc37.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-14 12:58:06 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:

Description r3obh 2022-05-10 18:50:37 UTC
Description of problem:
Option --si doesn't switch from default (kibibytes) to international units (kilobytes) when unit is not specified.

Version-Release number of selected component (if applicable):
procps-ng-3.3.17-3.fc35.x86_64

How reproducible:
Always

Steps to Reproduce:
1. $ free 
               total        used        free      shared  buff/cache   available
Mem:       297144608     1898016   293631640       23780     1614952   293515612
Swap:      196603896           0   196603896

2. $ free --kibi
               total        used        free      shared  buff/cache   available
Mem:       297144608     1895936   293633688       23780     1614984   293517700
Swap:      196603896           0   196603896

3. $ free --si
               total        used        free      shared  buff/cache   available
Mem:       297144608     1897764   293631892       23780     1614952   293515864
Swap:      196603896           0   196603896

3. $ free --kilo
               total        used        free      shared  buff/cache   available
Mem:       304276078     1942495   300679864       24350     1653719   300561076
Swap:      201322389           0   201322389


Actual results:
free --si is the same as free --kibi.

Expected results:
free --si should be the same as free --kilo.

Comment 1 Jan Rybar 2022-09-19 14:44:41 UTC
Hello,

yes, this seems to be an intention indeed.
https://gitlab.com/procps-ng/procps/-/blob/master/free.c#L121

`--si` option seems to be only effective with `-h` (human readable) which makes sense and manpage implicitly describes that as such (yes, implicitly). 
As the default is not `-h` (human readable), but kibibytes, the SI output would be kilobytes, and this can be invoked by `--kilo` option instead of `--si`.

Yet, I believe a change can be made either in manpage to clarify this better or in code, shall the upstream maintainers agree with it.

Comment 2 Jan Rybar 2022-09-20 14:13:24 UTC
Made a pull request at upstream:
https://gitlab.com/procps-ng/procps/-/merge_requests/163

Comment 3 Jan Rybar 2022-09-29 15:25:53 UTC
Fixed in rawhide so far.

Comment 4 Fedora Update System 2022-10-04 18:10:21 UTC
FEDORA-2022-0acb497215 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-0acb497215

Comment 5 Fedora Update System 2022-10-04 20:47:41 UTC
FEDORA-2022-0acb497215 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-0acb497215`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-0acb497215

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2022-10-05 12:23:51 UTC
FEDORA-2022-1850eac8a3 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-1850eac8a3

Comment 7 Fedora Update System 2022-10-06 14:17:06 UTC
FEDORA-2022-1850eac8a3 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-1850eac8a3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-1850eac8a3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2022-10-06 17:51:05 UTC
FEDORA-2022-13aff5aadc has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-13aff5aadc

Comment 9 Fedora Update System 2022-10-07 16:00:00 UTC
FEDORA-2022-13aff5aadc has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-13aff5aadc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-13aff5aadc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2022-10-14 12:58:06 UTC
FEDORA-2022-13aff5aadc has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2022-11-10 22:11:06 UTC
FEDORA-2022-1850eac8a3 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.