From a8c663bb42612afb58965c091846ee026bc702fc Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 20 Sep 2024 15:58:59 +0300 Subject: [PATCH] pipespace_new(): decrease uidinfo pipebuf usage if reservation check failed (cherry picked from commit 40769168a5ee227b96ea91768555eef332a0dc26) --- sys/kern/sys_pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 380bc165cef..20bedd665ca 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -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;