# DF-2792 — sys_ioprio_get(PRIO_PGRP) compares p_nice but assigns p_ionice

## What

Copy-paste bug at sys/kern/kern_resource.c:365-369: the PRIO_PGRP scan of
`sys_ioprio_get()` gates each member on `p->p_nice` (the CPU nice) but
assigns `p->p_ionice`, while the PRIO_PROCESS (:340-352) and PRIO_USER
(:399-413) paths compare `p_ionice`. The intended result is the maximum
ionice of the group; the actual result is order-dependent garbage, and the
call can even return ESRCH despite live members (when no member's nice
exceeds the running high / the sentinel IOPRIO_MIN-2 = -1).

## Build

```
cc -O2 -o ioprio_pgrp ioprio_pgrp.c
```

## Run (unprivileged, deterministic, no race)

```
./ioprio_pgrp
```

## Expected output

```
members ionice: parent=1 childA(pid A)=2 childB(pid B)=8
ioprio_get(PRIO_PGRP,  P)  = 2   (correct max = 8)
ioprio_get(PRIO_USER, uid) = 8
REPRODUCED: pgrp result 2 != expected max 8
```

Reproduced identically on the stock kernel (#0) and on the DF-2791-patched
kernel (#1) — independent of that fix.

## Fix

`fix.diff` — compare `p->p_ionice` instead of `p->p_nice` (one line).
Authored post-verification; kernel rebuild for this one-liner was not
performed (fix_status: not_testable).
