Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Dec 2008 16:11:09 +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: r185864 - in head/sys: compat/linprocfs fs/procfs
Message-ID:  <200812101611.mBAGB9ik035734@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Dec 10 16:11:09 2008
New Revision: 185864
URL: http://svn.freebsd.org/changeset/base/185864

Log:
  Relock user map earlier, to have the lock held when break leaves the
  loop earlier due to sbuf error.
  
  Pointy hat to:	me
  Submitted by:	dchagin

Modified:
  head/sys/compat/linprocfs/linprocfs.c
  head/sys/fs/procfs/procfs_map.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- head/sys/compat/linprocfs/linprocfs.c	Wed Dec 10 16:02:54 2008	(r185863)
+++ head/sys/compat/linprocfs/linprocfs.c	Wed Dec 10 16:11:09 2008	(r185864)
@@ -969,11 +969,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
 		    );
 		if (freename)
 			free(freename, M_TEMP);
+		vm_map_lock_read(map);
 		if (error == -1) {
 			error = 0;
 			break;
 		}
-		vm_map_lock_read(map);
 		if (last_timestamp + 1 != map->timestamp) {
 			/*
 			 * Look again for the entry because the map was

Modified: head/sys/fs/procfs/procfs_map.c
==============================================================================
--- head/sys/fs/procfs/procfs_map.c	Wed Dec 10 16:02:54 2008	(r185863)
+++ head/sys/fs/procfs/procfs_map.c	Wed Dec 10 16:11:09 2008	(r185864)
@@ -219,12 +219,11 @@ procfs_doprocmap(PFS_FILL_ARGS)
 
 		if (freepath != NULL)
 			free(freepath, M_TEMP);
-
+		vm_map_lock_read(map);
 		if (error == -1) {
 			error = 0;
 			break;
 		}
-		vm_map_lock_read(map);
 		if (last_timestamp + 1 != map->timestamp) {
 			/*
 			 * Look again for the entry because the map was



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