Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Mar 2014 13:04:16 +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-10@freebsd.org
Subject:   svn commit: r263359 - stable/10/sys/vm
Message-ID:  <201403191304.s2JD4Gi5041151@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar 19 13:04:16 2014
New Revision: 263359
URL: http://svnweb.freebsd.org/changeset/base/263359

Log:
  MFC r263092:
  Do not vdrop() the tmpfs vnode until it is unlocked.  The hold
  reference might be the last, and then vdrop() would free the vnode.

Modified:
  stable/10/sys/vm/vm_object.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_object.c
==============================================================================
--- stable/10/sys/vm/vm_object.c	Wed Mar 19 13:02:26 2014	(r263358)
+++ stable/10/sys/vm/vm_object.c	Wed Mar 19 13:04:16 2014	(r263359)
@@ -536,17 +536,18 @@ vm_object_deallocate(vm_object_t object)
 				vhold(vp);
 				VM_OBJECT_WUNLOCK(object);
 				vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-				vdrop(vp);
 				VM_OBJECT_WLOCK(object);
 				if (object->type == OBJT_DEAD ||
 				    object->ref_count != 1) {
 					VM_OBJECT_WUNLOCK(object);
 					VOP_UNLOCK(vp, 0);
+					vdrop(vp);
 					return;
 				}
 				if ((object->flags & OBJ_TMPFS) != 0)
 					VOP_UNSET_TEXT(vp);
 				VOP_UNLOCK(vp, 0);
+				vdrop(vp);
 			}
 			if (object->shadow_count == 0 &&
 			    object->handle == NULL &&



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