Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 2020 23:40:25 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r358827 - head/sys/kern
Message-ID:  <202003092340.029NePpG076367@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Mar  9 23:40:25 2020
New Revision: 358827
URL: https://svnweb.freebsd.org/changeset/base/358827

Log:
  pipe: explain why not deallocating inode number is fine.
  
  Suggested and reviewed by:	markj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D24009

Modified:
  head/sys/kern/sys_pipe.c

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c	Mon Mar  9 23:08:24 2020	(r358826)
+++ head/sys/kern/sys_pipe.c	Mon Mar  9 23:40:25 2020	(r358827)
@@ -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?202003092340.029NePpG076367>