node-io: match io.max readback on wbps so the guard stops rewriting

This commit is contained in:
Lance Walters 2026-10-26 17:12:21 -04:00
commit c66fbd9da1

View file

@ -71,8 +71,10 @@ apply_io_max() {
dir="$(find_dind_cgroup)" || return 1
want="259:0 wbps=${WMAX}"
cur="$(cat "${dir}/io.max" 2>/dev/null || true)"
# blk-throttle reads back all four fields ("259:0 rbps=max wbps=40M ..."),
# so match on the wbps field alone, not on the exact written string.
case "${cur}" in
*"${want}"*) : ;;
*"wbps=${WMAX}"*) : ;;
*)
if echo "${want}" > "${dir}/io.max" 2>/dev/null; then
log "applied io.max '${want}' to ${dir#"${CGROOT}"} (was '${cur}')"