Skip to content

Bogus warning: nice: max value out of range: 20 (19 max) #1657

Open
@rfjakob

Description

@rfjakob

Please acknowledge the following before creating a ticket

Description of the bug:

Using --nice=-20 causes this bogus warning:

nice: max value out of range: 20 (19 max)

Running under strace shows that the value -20 is actually accepted despite the warning:

[pid 40039] setpriority(PRIO_PROCESS, 0, -20) = 0

Environment: Fedora 38

fio version: fio-3.36-6-gc11e2 (compiled from git right now, but same behavoir on fio-3.36 and with Fedora and Debian fio packages)

Reproduction steps

$ sudo ./fio --name=foo --filename=/tmp/fio.tmp --size=1M --nice=-20
nice: max value out of range: 20 (19 max)
foo: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.36-6-gc11e2
Starting 1 process
[...]
$ sudo ./fio --debug=parse --name=foo --filename=/tmp/fio.tmp --size=1M --nice=-20
fio: set debug option parse
parse    40053 dup options
parse    40053 handle_option=name, ptr=foo
parse    40053 __handle_option=name, type=OPT_STR_STORE, ptr=foo
parse    40053 handle_option=filename, ptr=/tmp/fio.tmp
parse    40053 __handle_option=filename, type=OPT_STR_STORE, ptr=/tmp/fio.tmp
parse    40053 handle_option=size, ptr=1M
parse    40053 __handle_option=size, type=OPT_STR_VAL_ZONE, ptr=1M
parse    40053   ret=0, out=1048576
parse    40053 handle_option=nice, ptr=-20
parse    40053 __handle_option=nice, type=OPT_INT, ptr=-20
parse    40053   ret=0, out=18446744073709551596
parse    40053 __handle_option=nice, type=OPT_INT, ptr=20
parse    40053   ret=0, out=20
nice: max value out of range: 20 (19 max)
foo: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
parse    40053 free options
fio-3.36-6-gc11e2
Starting 1 process
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpatcheswelcomeNo one internal is working on this but an external contributor's help is very welcome!triagedIssue cause is understood but a patch is needed to fix it

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions