1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00

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

Submitted by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2024-09-20 15:58:59 +03:00
parent d6074f73af
commit 40769168a5

View File

@ -595,6 +595,7 @@ pipespace_new(struct pipe *cpipe, int size)
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;