node-io: match io.max readback on wbps so the guard stops rewriting
This commit is contained in:
parent
6d9f5176e1
commit
c66fbd9da1
1 changed files with 3 additions and 1 deletions
|
|
@ -71,8 +71,10 @@ apply_io_max() {
|
||||||
dir="$(find_dind_cgroup)" || return 1
|
dir="$(find_dind_cgroup)" || return 1
|
||||||
want="259:0 wbps=${WMAX}"
|
want="259:0 wbps=${WMAX}"
|
||||||
cur="$(cat "${dir}/io.max" 2>/dev/null || true)"
|
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
|
case "${cur}" in
|
||||||
*"${want}"*) : ;;
|
*"wbps=${WMAX}"*) : ;;
|
||||||
*)
|
*)
|
||||||
if echo "${want}" > "${dir}/io.max" 2>/dev/null; then
|
if echo "${want}" > "${dir}/io.max" 2>/dev/null; then
|
||||||
log "applied io.max '${want}' to ${dir#"${CGROOT}"} (was '${cur}')"
|
log "applied io.max '${want}' to ${dir#"${CGROOT}"} (was '${cur}')"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue