Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 2019 11:46:01 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349368 - head/sys/fs/cuse
Message-ID:  <201906251146.x5PBk1fM035474@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Jun 25 11:46:01 2019
New Revision: 349368
URL: https://svnweb.freebsd.org/changeset/base/349368

Log:
  Free all allocated unit IDs in cuse(3) after the client character
  devices have been destroyed to avoid creating character devices with
  identical name.
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/fs/cuse/cuse.c

Modified: head/sys/fs/cuse/cuse.c
==============================================================================
--- head/sys/fs/cuse/cuse.c	Tue Jun 25 11:42:53 2019	(r349367)
+++ head/sys/fs/cuse/cuse.c	Tue Jun 25 11:46:01 2019	(r349368)
@@ -671,14 +671,14 @@ cuse_server_unref(struct cuse_server *pcs)
 
 	TAILQ_REMOVE(&cuse_server_head, pcs, entry);
 
-	cuse_free_unit_by_id_locked(pcs, -1);
-
 	while ((pcsd = TAILQ_FIRST(&pcs->hdev)) != NULL) {
 		TAILQ_REMOVE(&pcs->hdev, pcsd, entry);
 		cuse_unlock();
 		cuse_server_free_dev(pcsd);
 		cuse_lock();
 	}
+
+	cuse_free_unit_by_id_locked(pcs, -1);
 
 	while ((mem = TAILQ_FIRST(&pcs->hmem)) != NULL) {
 		TAILQ_REMOVE(&pcs->hmem, mem, entry);



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