Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Oct 2019 21:23:45 +0000 (UTC)
From:      John Baldwin <jhb@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: r354101 - stable/12/sys/kern
Message-ID:  <201910252123.x9PLNjJX039666@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Oct 25 21:23:44 2019
New Revision: 354101
URL: https://svnweb.freebsd.org/changeset/base/354101

Log:
  MFC 353371: Don't free the cursor boundary tag during vmem_destroy().
  
  The cursor boundary tag is statically allocated in the vmem instead of
  from the vmem_bt_zone.  Explicitly remove it from the vmem's segment
  list in vmem_destroy before freeing all the segments from the vmem.

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

Modified: stable/12/sys/kern/subr_vmem.c
==============================================================================
--- stable/12/sys/kern/subr_vmem.c	Fri Oct 25 21:21:21 2019	(r354100)
+++ stable/12/sys/kern/subr_vmem.c	Fri Oct 25 21:23:44 2019	(r354101)
@@ -466,6 +466,7 @@ static void
 bt_remseg(vmem_t *vm, bt_t *bt)
 {
 
+	MPASS(bt->bt_type != BT_TYPE_CURSOR);
 	TAILQ_REMOVE(&vm->vm_seglist, bt, bt_seglist);
 	bt_free(vm, bt);
 }
@@ -843,6 +844,7 @@ vmem_destroy1(vmem_t *vm)
 	VMEM_LOCK(vm);
 	MPASS(vm->vm_nbusytag == 0);
 
+	TAILQ_REMOVE(&vm->vm_seglist, &vm->vm_cursor, bt_seglist);
 	while ((bt = TAILQ_FIRST(&vm->vm_seglist)) != NULL)
 		bt_remseg(vm, bt);
 



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