pipespace_new(): decrease uidinfo pipebuf usage if reservation check failed

(cherry picked from commit 40769168a5ee227b96ea91768555eef332a0dc26)
This commit is contained in:
Konstantin Belousov 2024-09-20 15:58:59 +03:00
parent 6536b979b8
commit a8c663bb42

View file

@ -596,6 +596,7 @@ retry:
if (priv_check(curthread, PRIV_PIPEBUF) != 0 && maxpipekva / 100 *
(100 - pipebuf_reserv) < amountpipekva + size) {
vm_map_unlock(pipe_map);
chgpipecnt(cpipe->pipe_pair->pp_owner->cr_ruidinfo, -size, 0);
if (cpipe->pipe_buffer.buffer == NULL &&
size > SMALL_PIPE_SIZE) {
size = SMALL_PIPE_SIZE;