svn commit: r359013 - stable/12/sys/kern

Konstantin Belousov kib at FreeBSD.org
Mon Mar 16 11:42:04 UTC 2020


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;
 	}


More information about the svn-src-stable mailing list