Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2020 11:42:04 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r359013 - stable/12/sys/kern
Message-ID:  <202003161142.02GBg4ol040465@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Mar 16 11:42:03 2020
New Revision: 359013
URL: https://svnweb.freebsd.org/changeset/base/359013

Log:
  MFC r358827:
  pipe: explain why not deallocating inode number is fine.

Modified:
  stable/12/sys/kern/sys_pipe.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/sys_pipe.c
==============================================================================
--- stable/12/sys/kern/sys_pipe.c	Mon Mar 16 11:40:59 2020	(r359012)
+++ stable/12/sys/kern/sys_pipe.c	Mon Mar 16 11:42:03 2020	(r359013)
@@ -367,6 +367,15 @@ pipe_paircreate(struct thread *td, struct pipepair **p
 		goto fail;
 	error = pipe_create(wpipe, false);
 	if (error != 0) {
+		/*
+		 * This cleanup leaves the pipe inode number for rpipe
+		 * still allocated, but never used.  We do not free
+		 * inode numbers for opened pipes, which is required
+		 * for correctness because numbers must be unique.
+		 * But also it avoids any memory use by the unr
+		 * allocator, so stashing away the transient inode
+		 * number is reasonable.
+		 */
 		pipe_free_kmem(rpipe);
 		goto fail;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003161142.02GBg4ol040465>